function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AviAviAviAvi 

XML - Utf-16

Hello all,

do you know if SF support in (parsing) XML that encoding in UTF-16.

 

the probem is that I send httpRequest and I received the xml but if I'm trying to display the content or just pars the xml an errror message raise "ParseError at [row,col]:[1,1]Message: Content is not allowed in prolog."

facts:
1.) I already trying to setHeader(before the http.send) to content-type,UTF-16 (;charset=utf-16).
2.) I'm trying to display the (getBody()) of the xml in visualforce page - and I recieved a lot weird charcters,
like question mark or something.

3.) all those problems not happened if the xml encoded in UTF-8.

4.) 

ErrorLog4 = ''; HttpRequest req = new HttpRequest(); req.setEndpoint(XML FILE PATH); req.setMethod('GET'); req.setHeader('Content-Type', 'text/xml'); Http http = new Http(); HTTPResponse res = http.send(req); String responseBody = res.getBody() ; Xmlstreamreader xmlreader = new Xmlstreamreader(responseBody) ; try { ErrorLog1 += responseBody ; // Weird Characters been displayed //ErrorLog3 += xmlreader.nextTag() ; // Error message }

 Thanks in advance,
Avi.


 

PrachiPrachi

Hi,

 

I'm facing the same problem. Did you find a solution to this.

 

Thanks

RayGRayG

Same problem here too.  Any ideas?