HTTP GET Request XML-encoding issue

I’m using HTTP Request activity to GET data from a XML-file.
This activity loses special characters(ä,ö,å) and replaces them with a replacement character(�), even though the XML file in case uses ISO-8859-1 encoding which should allow these said characters.

I’ve tried adding Header parameters that should mimic browser’s behavior but that does not help.

My current workaround is that I do the request with a PowerShell-script - which does not replace special characters - in an Invoke PS activity. Only issue with this is that I lose some performance, HTTP Req activity is faster than running a PS script.

Is this a known issue or am I simply missing some activity option that would not mess with the encoding?

1 Like

hi Topi,

is this happening only when you request data from an XML? have you tried a link that has in its body the same type of characters?

Hi,

after some testing I noticed that on some html pages it properly shows them and on some it does not. I’ll try to figure what the difference between those are.

Also if the response is JSON it has no issues with characters.

i did a simple test and it works as expected. maybe your problem is with a specific xml file. let me know if you find which one causes this error and maybe you can send it to us.

First difference I noticed between these two pages is that the properly displaying one has charset determined in the head-element while the other has no notification of charsets.

Finding working ‘input encoding’ won’t help me though as I have no control over the XML-files that i’m receiving.
So only solution would be to somehow tell the HTTP Req activity to allow characters or encoding in headers;
Accept: text/html, application/xhtml+xml, image/jxr, /
Accept-Encoding: gzip, deflate

If the syntax is same as with passing parameters it should be so that Name= Accept-Encoding and Value= gzip ?

Actually just noticed that you removed the option to include Headers in the newer version of UiPath. In 2016.2.6192 it is still present but not in the latest one. Guess that explains why it didn’t seem to really do anything.

Okay, now we’re getting somewhere. When I updated my Studio to the latest version and changed the HTTP Request’s Accept Response as: to XML it gave me the following error:

HTTP Error 406.0 - Not Acceptable

The resource cannot be displayed because the file extension is not being accepted by your browser.

Most likely causes:

  • The request was rejected because it contained an Accept header for a MIME type that is not supported for the requested file extension.

Things you can try:

  • Verify the MIME settings for the file extension that was requested to make sure this MIME type is acceptable.

This was the Response info:
Response Status: Completed
Status Code: 406
Content-Type: text/html; charset=utf-8

Hi! I think I have the same problem.

This is an URL to get some Spanish Antena´s information provided by the Spanish Government web page:

https://geoportal.minetur.gob.es/VCTEL/infoantenasGeoJSON.do?idCapa=null&bbox=-3.7294853401185%2C40.45136809349%2C-3.7156880569459%2C40.459854602814&zoom=4

If I download the resource (JSON file) an visualize it with, for example, Sublime Text, I have no problems with encoding.

But if I use the HTTP Request Wizard in UiPath, the Preview Window doesn´t show the correct characters.

I have no idea what might be happening, since the char-set used is informed in the “response info” tab.

I have this problem too.
The only way I found out was to save the file via activity HTTP Request (using Download Resource) and then use activity Read Text File with encoding and after you can deserialize this string
Someone has another way ?

2 Likes

This way working fine. Download resource and then read Text file with Correct encoding works fine.

1 Like