in reply to how to get exactly same text from a file

Ok, my perl is 5.14. this is the garbled character I'm getting from the website and I want to convert it into it's real form. Any idea how to do this?
  • Comment on Re: how to get exactly same text from a file

Replies are listed 'Best First'.
Re^2: how to get exactly same text from a file
by Anonymous Monk on Nov 26, 2012 at 13:15 UTC
    Ok, my perl is 5.14. this is the garbled character : ต้มยำกุ้ง I'm getting from the website and I want to convert it into it's real form. Any idea how to do this?

      Since you're using HTTP (you should've said so in the beginning!), which encoding do you serve your output with? (the Content-Type header.) Which encoding is the file saved with? (ISO8859-1, 8859-15, UTF-8, UTF-16LE?) What output does perl -MData::Dumper -e '$Data::Dumper::Useqq=1;  print Dumper(scalar <>)' test.txt give you? Can you view the file in a terminal? What is your terminal's encoding?

      (I'm interested in a Danish-to-Hindi translator, so if your code happens to output the file in Hindi, I'd love to examine it.)