Page 1 of 1

API return unreadable characters.

Posted: Thu Oct 18, 2018 12:04 am
by dimsum
Hi,

I have used an API but I got an unreadable string.
"host_name": "\u0e41\u0e21\u0e48\u0e2e\u0e48\u0e2d\u0e07\u0e2a\u0e2d\u0e19_\u0e1b\u0e32\u0e07\u0e21\u0e30\u0e1c\u0e49\u0e32"
My host_name is Thai characters. Can I get the Thai characters?

Thank you.

Re: API return unreadable characters.

Posted: Thu Oct 18, 2018 12:05 pm
by lmiltchev
This is exactly what you would see in a browser, under the "Raw Data" tab. The browser takes care of the conversion to Thai characters (under the JSON tab), and makes it "pretty". There is probably a way to do the same when you run the curl command from the CLI, but you would have to use some kind of script to convert the characters to utf-8. I tried using "iconv" from the CLI, but I was not able to make it work. Perhaps the conversion could be achieved via a php script. We will have to do some more digging into this.