1

I am getting this output when run one page :

à °¨à ±‡à °¨à ± Ã

I need to convert this message into unicode message

thanks

Ravan Vinod
  • 33
  • 1
  • 1
  • 8
  • You're going to have to provide a lot more information than you posted. http://www.biostars.org/p/75548/ – mah Feb 22 '14 at 15:47
  • @biostars.org Dear Sir, I am trying to implement One CSV file for Download from database rows But instead of local language i am getting à °¨à ±‡à °¨à ± à like this code.....:) – Ravan Vinod Feb 22 '14 at 17:52
  • CSV is being saved in UTF-8 encoding, but Excel is reading it in as code page 1252 Western European. You can persuade Excel to import as UTF-8 instead by putting a fake-BOM (bytes `"\xEF\xBB\xBF"`) at the start of the CSV file (though this is a bit dodgy and it's not the only problem with Excel's CSV import). However also the data were lightly mangled before they were output in UTF-8—it looks like they've been transcoded from ISO-8859-1 to UTF-8 even though they were already UTF-8. Possibly `utf8_encode()` is being inappropriately called. – bobince Feb 24 '14 at 10:53

1 Answers1

2

This seems very much like you are outputting unicode (more precise: utf-8 encoded characters) correctly, but don't declare it in your Content-Type, so the browser assumes it's iso-8859-1 and displays it like that.

Something like

header("Content-type: text/html; charset=utf-8");

should help.

Guntram Blohm
  • 9,667
  • 2
  • 24
  • 31
  • @GuntramBlom Thanks a lot..for Ur reply ...it was working fine when i am calling from browser. But when i am trying to download the data as a csv file format but i am getting à°…à°¸à±à°¦à±à°˜à°¸ – Ravan Vinod Feb 22 '14 at 17:51
  • http://stackoverflow.com/questions/4348802/how-can-i-output-a-utf-8-csv-in-php-that-excel-will-read-properly/4762708#4762708 – Ravan Vinod Feb 25 '14 at 11:27