Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error in reading Latin caron character(Č, č, ď, ě, ň, ř, ť, ů) in Java I18N

869367Jun 16 2011 — edited Jul 4 2011
Hi,
While reading Czech characters, some of Latin characters with caron (Ex: Č, č, ď, ě, ň, ř, ť, ů), these characters displayed as '?', we tried to fix it through generate Unicode using native2ascii tool in jdk for these characters we can't generate the Unicode properly, please give us a quick solution/references/suggestions.



String czech = "Č, č, ď, ě, ň, ř, ť, ů";
try {
System.out.println("UTF-8 czech: " + new String(czech.getBytes("UTF-8"), "UTF-8"));
System.out.println("UTF-8 ascii: " + new String(asciiCzech.getBytes("8859_1"), "8859_1"));
} catch (Exception e) { e.printStackTrace();
}


The generated unicode are: \u02d9\u0163,

Note: We tried the native2ascii for Windows-1252, Cp1252, ISO-8859-1 and ISO-8859-2 encoding methods.

Please give us some solution to read this type of caron characters in Java.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2011
Added on Jun 16 2011
5 comments
1,902 views