Display Japanese Character from Encoded URL
I was doing a small task on php (Even tried on cold-fusion).
There is an API that sends me URL of following Pattern:
xyz.com?para1=foo&brand=%93%FA%8EY%8E%A9%93%AE%8E%D4
xyz.com?para1=foo&brand=Airtel%20India%20Mobile%20Corporation
I have to display the brand name. When I simply print brand name as:
echo $_GET['brand']
, than I am getting correct output for URL 2. However, I am getting wrong
output for 1. URL 1 prints weird set of character.
It prints :
"úY©"®Ô
Then What I did is:
Right Clicked on IE->Selected Encoding-> Selected Shift_JIS as Encoding.
As soon as I did, I got the correct output.
日産自動車
How can I do it using PHP (and/or) Cold-Fusion?
Any help is appreciated.
No comments:
Post a Comment