This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

intl patches (8)


This fix is needed so people can do
  bind_textdomain_codeset (domain, "ISO-8859-1//TRANSLIT");
(The bind_textdomain_codeset documentation says that the second argument
can be any encoding name acceptable to iconv_open(), therefore
"ISO-8859-1//TRANSLIT" is valid here.)


2002-04-30  Bruno Haible  <bruno@clisp.org>

	* intl/loadmsgcat.c (_nl_init_domain_conv): Don't append //TRANSLIT to
	the encoding if it already has slashes.
	Reported by Perry Rapp <prapp@erols.com>.

--- glibc-20021126/intl/loadmsgcat.c.bak	Mon Aug  5 13:24:33 2002
+++ glibc-20021126/intl/loadmsgcat.c	Wed Dec 11 15:29:32 2002
@@ -829,20 +829,23 @@
 	     we want to use transliteration.  */
 #   if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
        || _LIBICONV_VERSION >= 0x0105
-	  len = strlen (outcharset);
-	  if (len < 10 || strcmp (outcharset + len - 9, "/TRANSLIT") != 0)
+	  if (strchr (outcharset, '/') == NULL)
 	    {
-	      char *tmp = (char *) alloca (len + 10 + 1);
+	      char *tmp;
+
+	      len = strlen (outcharset);
+	      tmp = (char *) alloca (len + 10 + 1);
 	      memcpy (tmp, outcharset, len);
 	      memcpy (tmp + len, "//TRANSLIT", 10 + 1);
 	      outcharset = tmp;
+
+	      domain->conv = iconv_open (outcharset, charset);
+
+	      freea (outcharset);
 	    }
+	  else
 #   endif
-	  domain->conv = iconv_open (outcharset, charset);
-#   if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
-       || _LIBICONV_VERSION >= 0x0105
-	  freea (outcharset);
-#   endif
+	    domain->conv = iconv_open (outcharset, charset);
 #  endif
 # endif
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]