lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
authorMartin Kahlert <martin.kahlert@infineon.com>
Fri, 29 Mar 2002 19:33:25 +0000 (19:33 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 29 Mar 2002 19:33:25 +0000 (19:33 +0000)
2002-03-29  Martin Kahlert  <martin.kahlert@infineon.com>

* lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.

From-SVN: r51566

gcc/java/ChangeLog
gcc/java/lex.c

index 21be2063c834cd0371e2f1c2d565208909e3e0c3..3006c856672c28c5225e49a609986f25df9d5935 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-29  Martin Kahlert  <martin.kahlert@infineon.com>
+
+       * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
+
 2002-03-28  Tom Tromey  <tromey@redhat.com>
 
        * except.c (expand_end_java_handler): If the handler type is NULL,
index 8c661189a3934423a48cc5cef3f6297475a79c18..69e16b4bf1cb02a20cfa3c7556efef55863cf763 100644 (file)
@@ -290,8 +290,13 @@ java_new_lexer (finput, encoding)
       /* If iconv failed, use the internal decoder if the default
         encoding was requested.  This code is used on platforms where
         iconv exists but is insufficient for our needs.  For
-        instance, on Solaris 2.5 iconv cannot handle UTF-8 or UCS-2.  */
-      if (strcmp (encoding, DEFAULT_ENCODING))
+        instance, on Solaris 2.5 iconv cannot handle UTF-8 or UCS-2.
+
+        On Solaris the default encoding, as returned by nl_langinfo(),
+        is `646' (aka ASCII), but the Solaris iconv_open() doesn't
+        understand that.  We work around that by pretending
+        `646' to be the same as UTF-8.   */
+      if (strcmp (encoding, DEFAULT_ENCODING) && strcmp (encoding, "646"))
        enc_error = 1;
 #ifdef HAVE_ICONV
       else