XML to JSON Transform and ÖÄ characters

Hi,

I am running the Tyk Gateway and Dashboard on premise.

I am using the body transform to change a XML reply to JSON. I struggled for some time only to find that the problem is with the character Ö and Ä. When I test these in the XML message the JSON on the other side is left blank.

Here is the example from the documentation with 2 Finnish city names instead when testing it on the Dashboard:

<?xml version="1.0" encoding="utf-8"?>
<servers version="1">
    <server>
        <serverName>Jyväskylä</serverName>
        <serverIP>127.0.0.1</serverIP>
    </server>
    <server>
        <serverName>Hyvinkää</serverName>
        <serverIP>127.0.0.2</serverIP>
    </server>
</servers>


Result:
{

}

Has anyone come across something similar?

Br,
Louis

Have you tried using the tester in the dashboard? Yu can pre-test your template without needing to save and reload - you should also then see error output in the dashboard logs if there was a problem.

Hi,

That is how I found it. I pasted the example input and template from the documentation into the Dashboard Endpoint Designer. Changed the two city names to Finnish cities and with Ä and Ö in it and the the result is empty.


When I don’t do a transform on the response the whole XML does pass through without problems.

Br,
Louis

Hi Louis,

OK thanks for the report, I’ve raised it as a bug here:

We’ll try and get it into our next point release (there are two patches coming before that).

M.

Well, that is great.
Cheers!

Hi Louis,

I’m looking into this issue for 2.4 and haven’t been able to reproduce the issue so far. I’ve posted some details in the issue tracker over at GitHub: Body transform doesn't seem to handle non-ascii characters · Issue #642 · TykTechnologies/tyk · GitHub

Could you please reply there with more bits of information? Especially interested in what Tyk versions (gateway and/or dashboard) you’re running and what the API definition looks like.

Thank you!

Hi,

I have the following version installed:
tyk-dashboard 1.3.2 amd64
tyk-gateway 2.3.3 amd64

Br,
Louis

Could you reply in the GitHub issue? It’s easier to keep track of the info there, and I’ll post any updates there too. Thank you!