This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/14687] New: Incorrect UTF-8 byte->String conversion
- From: "joeclark at iastate dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2004 04:44:14 -0000
- Subject: [Bug java/14687] New: Incorrect UTF-8 byte->String conversion
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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