itnifl
asked on
Getting Chinese from my Perl script or browser
My Perl script creates xml and outputs it to the browser. However, the code is not working as it should. The funny part is that I got a bunch of chinese letters as output, or maybe the browser interpreted it that way, I don't know. I am using Chrome. Got to wonder if anything of this makes sense?
Adding the letters as a screenshot, they won't display correctly here on the webpage.
Google translate couldn't make much out of it..
Chinese.png
Adding the letters as a screenshot, they won't display correctly here on the webpage.
Google translate couldn't make much out of it..
Chinese.png
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I understand - the code shown above is the code that now is working. I send text to the sub and it outputs it as xml. The sub shown here is a bit revised, so this one only shows two tags nested. The idea is the same as what I use in my code though.
The code that produced the chinese characters was simply a print statement with an xml header, as shown in the thread here above(e.g. <?xml version="1.0" encoding="UTF-8"?>) and then another print statement with my xml code in one long string (e.g "<tag1><tag2></tag2></tag1 >").
Weird stuff that chrome should pick up Chinese letters as a result of that. Do the Chinese letters have some kind of ascii codes? Is it possible that my previously invalid code could output something that could have been interpreted as ascii codes for Chinese by the browser?
The code that produced the chinese characters was simply a print statement with an xml header, as shown in the thread here above(e.g. <?xml version="1.0" encoding="UTF-8"?>) and then another print statement with my xml code in one long string (e.g "<tag1><tag2></tag2></tag1
Weird stuff that chrome should pick up Chinese letters as a result of that. Do the Chinese letters have some kind of ascii codes? Is it possible that my previously invalid code could output something that could have been interpreted as ascii codes for Chinese by the browser?
ASKER
I guess there is no more a solution to this then displayed here..
ASKER
Open in new window
And that works without any Chinese output to my browser. But I still think those characters were weird, and wonder where they came from. Google translate did translate it from Chinese to English, so the characters must have been Chinese, but the translation made no sense.