-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.1.8
-
x86
-
windows_nt
Name: et89391 Date: 07/22/99
To execute code, use this command:
"java -Dfile.encoding=iso-8859-2 ErrorInEncoding":
----------------------------------------------------------------
import java.io.*;
import java.util.*;
public class ErrorInEncoding {
static public void main(String[] args)
throws UnsupportedEncodingException,IOException
{
String smallCzechLetters =
"a\u00e1bc\u010dd\u010fe\u00e9\u011bfghi\u00edjklmn\u0148o\u00f3pqr\u0159s\u0161t\u0165u\u00fa\u016fvwxy\u00fdz\u017e";
// get 8-bit chars in iso-8859-2
byte [] ISO2bytes = smallCzechLetters.getBytes("iso-8859-2");
// convert them
String explicit = new String(ISO2bytes,"iso-8859-2");
String implicit = new String(ISO2bytes);
// compare them
System.out.println((smallCzechLetters.equals(explicit)?"Match":"Not match"));
System.out.println((smallCzechLetters.equals(implicit)?"Match":"Not match"));
}
}
------------------------------------------------------------------
This will produce output "Match, Not match", so default encoding
used in String constructor is not matching the encoding specified
with -Dfile.encoding.
This bugs is in SUN JDK1.1.8 on WinNT,
it is not in IBM JDK1.1.6 on AIX
and is not in Blackdown.org JDK1.1.7v1a on Linux
others I haven't tried.
(Review ID: 63197)
======================================================================
- relates to
-
JDK-4310802 HTMLEditorKit does not parse TAGs for Cp037 character encoding
- Closed