简体   繁体   中英

XMLStreamReader Encoding

I have some characters from the Unicode Extension B Chinese/Japanese/Korean set in my XML:

𠀀𠀁𠀂𠀃𠀄𪛔𪛕𪛖 

But when I use streamReader.getText() it returns:

Does anyone know if Java's XMLStreamReader's encoding scheme for unicode characters can be changed?

It works with common East Asian characters, just not with the ones in Unicode Extension B.

when create XML Stream Reader, you can specify the encoding as UTF-8. Like the API below

abstract XMLStreamReader createXMLStreamReader(InputStream stream, String encoding)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM