PHP Classes

utf8 encoding

Recommend this page to a friend!

      MS-Excel Stream Handler  >  All threads  >  utf8 encoding  >  (Un) Subscribe thread alerts  
Subject:utf8 encoding
Summary:chinese characters utf8
Messages:5
Author:Kathy Stankiewicz
Date:2011-11-01 08:48:03
Update:2011-11-03 04:39:47
 

  1. utf8 encoding   Reply   Report abuse  
Picture of Kathy Stankiewicz Kathy Stankiewicz - 2011-11-01 08:48:04
Hi,
I can export to the file but when I open it the Chinese characters are not displaying properly. Is there a way to save the file as utf8?

  2. Re: utf8 encoding   Reply   Report abuse  
Picture of Ignatius Teo Ignatius Teo - 2011-11-01 22:56:11 - In reply to message 1 from Kathy Stankiewicz
Note, BIFF8 format supports UNICODE (aka UTF-16LE). Try converting your strings to UTF-16LE from UTF-8 first.

  3. Re: utf8 encoding   Reply   Report abuse  
Picture of Kathy Stankiewicz Kathy Stankiewicz - 2011-11-03 03:41:38 - In reply to message 2 from Ignatius Teo
Sorry not really sure how to do that. Do you mean when I'm creating the associative array?
Can you give me an example?

  4. Re: utf8 encoding   Reply   Report abuse  
Picture of Ignatius Teo Ignatius Teo - 2011-11-03 04:04:58 - In reply to message 3 from Kathy Stankiewicz
yes. mb_convert_encoding() or iconv()?

  5. Re: utf8 encoding   Reply   Report abuse  
Picture of Kathy Stankiewicz Kathy Stankiewicz - 2011-11-03 04:39:47 - In reply to message 4 from Ignatius Teo
Thanks, I tried but can't get either to work.

If I use mb_detect_encoding() on my string and it contains Chinese it comes back as UTF-8, then convert using mb_convert_encoding() and detect again. I still get UTF-8.

If I do the same but the field contains English, mb_detect says it's ASCII (before and after converting).

Any ideas?