Handling character encoding in xmappr

26 views
Skip to first unread message

Mohamad Charaf

unread,
Feb 2, 2010, 2:22:30 AM2/2/10
to xmappr
Is it possible to use xmappr with xml documents that have non ascii
characters? like arabic or any other languages? Is there any means to
set the character encoding when reading the document?

Peter Knego

unread,
Feb 2, 2010, 9:56:11 AM2/2/10
to xma...@googlegroups.com
Hi Mohamad,

Currently it's all UTF-8. So you can use non-ascii characters as long as they are UTF-8 encoded.

I'm investigating the possibility to support other encodings. Will let you know later on today.

Peter

Peter Knego

unread,
Feb 2, 2010, 2:59:36 PM2/2/10
to xma...@googlegroups.com
Hi Mohamad,

supporting any encoding is actually simple and I just tested it.

Xmappr takes as input a Reader, which produces a series of characters in correct encoding. This by default the default JVM encoding on your box.

To support any (java supported) encoding:

Reader reader = new InputStreamReader( new FileInputStream("/path/to/file.xml") , "cp1250");   // "cp1250" is an example encoding

Peter
Reply all
Reply to author
Forward
0 new messages