|Re: Encoding option ignored in class XMLProcessor [message #1203273 is a reply to message #1202752]
||Fri, 22 November 2013 15:19
| Ed Merks
Registered: July 2009
Oh, you mean this last line
should really use the encoding you've specified to decode the bytes.
That looks like a bug.
In any case, it would be better to use a StringWriter and avoid any
String -> byte -> String encoding. You could do that direct by
Resource, Map<?, ?>) with a StringWriter.
On 22/11/2013 3:06 PM, Arastoo Barji wrote:
> when using method saveToString(Resource, Map) of class XMLProcessor,
> encoding option can either be set by passing option
> XMLResource.OPTION_ENCODING with value "UTF-8" or by calling method
> setEncoding("UTF-8") on the passed XmlResource object. We did both but
> somehow saveToString(...) method ignores this option.
> We implemented a workaround by calling method
> save(ByteArrayOutputStream, Resource, Map) of class XMLProcessor where
> we pass an own ByteArrayOutputStream object where encoding is set to
> UTF-8 and write the content of the outputstream into a String
> afterwards. This workaround works, but does someone know why the first
> approach doesn't work correctly? We think this might be a bug of EMF
> package but maybe we just call the method in a wrong way.
Professional Support: https://www.macromodeling.com/
Powered by FUDForum
. Page generated in 0.01936 seconds