This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug java/14687] New: Incorrect UTF-8 byte->String conversion


The following code snippet, when given a valid sequence of ASCII bytes, works as
expected on Sun's JDK. However, with gcj 3.3.1 (Cygwin/mingw special), the
resulting program returns only "????" as the result string.  The same code using
"iso-8859-1" encoding works on both platforms.

try {
  String byteStr = new String(bytes, "UTF-8");
  System.out.println("byteStr = " + byteStr);
}

This problem was reported on the gcc java mailing list here:
http://gcc.gnu.org/ml/java/2003-09/msg00116.html.  However, apparently the
problem still exists, and the thread didn't end with any plans to fix the problem.

-- 
           Summary: Incorrect UTF-8 byte->String conversion
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joeclark at iastate dot edu
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14687


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