1

Tried to read UTF16 contents from CSV and convert it into UTF8 using mb_convert_encoding and do utf8_decode on the text. Now compare this text to the utf8_decoded text from webpage and write output to a xls.This works fine for almost all languages (German, English, French, Espanol, Italiano, Indonesian,....) except (Japanese, Russian, Turkei and few characters in Polski)

Tried iconv also....All in vain. Seek some help handling this UTF16 to UTf8 conversion

Anonymous
  • 11
  • 2
  • 2
    iconv should work. Can you show the code you are using? What exactly happens when you try? – Pekka Feb 21 '11 at 10:45
  • 1
    Are you sure it is UTF-16? I had a similar problem where content was something different to what I was expecting. – Treffynnon Feb 21 '11 at 11:05
  • Am a newbie to PHP, am not sure whether iconv is properly installed... Just downloaded inconv and libiconv.RCFile and places them in the directory along with other .dll files....Is the iconv.RC not recognised? or not properly installed? Want more info on iconv... I hope it should help me---Not in a position to share the input or the script also. For Polski, can find sometimes ? within a square For Russian, completely ???????? For Japanese, ???? and some characters like a with underscore beneath it. ª – Anonymous Feb 21 '11 at 11:07
  • Is it little-endian or big-endian (UTF-16LE or UTF-16BE)? or could it be UCS-2 rather than UTF-16? – Mark Baker Feb 21 '11 at 11:09
  • When i open the input in Notepad++ it says UCS2..But when i try using the mb_convert_encoding it recognises input only as UTF16, not even UCS2... Cannot give input as UTF16-LE or UTF-16-BE ..Both doesn't work..Only the following works(Atleast for few languages) - $in[0] = mb_convert_encoding($in[0], "UTF-8", "UTF-16"); – Anonymous Feb 21 '11 at 11:14
  • Tried to change "mbstring.language" to "Japanese" also...But no change – Anonymous Feb 21 '11 at 11:31
  • Tried to download, php_iconv.dll too – Anonymous Feb 21 '11 at 12:05

0 Answers0