Details
-
Type: Bug
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
I am using XStream 1.0.2. The following two codes produce the same output:
--------------- Sample 1 --------------
final XStream x1 = new XStream(new DomDriver("UTF-8"));
x1.toXML(teststring, new FileWriter("test-encoding-1.xml"));
--------------- Sample 2 --------------
final XStream x2 = new XStream(new DomDriver());
x2.toXML(teststring, new FileWriter("test-encoding-2.xml"));
--------------- End Samples -----------
Given the teststring variable is "Ää Öö Üu", the output for both is identical:
00000000h: 3C 73 74 72 69 6E 67 3E ; <string>
00000008h: C4 E4 20 D6 F6 20 DC FC ; Ää Öö Üü
00000010h: 3C 2F 73 74 72 69 6E 67 ; </string
00000018h: 3E ; >
Obviously, the umlaut encoding does not take place in UTF-8, which (to my expectations) would look like this:
00000000h: 3C 73 74 72 69 6E 67 3E ; <string>
00000008h: C3 84 C3 A4 20 C3 96 C3 ; Ãä Ã-Ã
00000010h: B6 20 C3 9C C3 BC 3C 2F ; ¶ Ãü</
00000018h: 73 74 72 69 6E 67 3E ; string>
The encoding of the above code snippets rather take place in my Windows XPs default encoding schema ISO-8859-1.
Issue Links
- is superceded by
-
XSTR-261 Xstream.fromXML(InputStream) should discover the stream encoding, impossible to specify output encoding
I noticed the same behaivor and I am using xstream 1.1.2
Are there any updates on this issue ?
Regards,
Matthias