note 50298 added to ref.mbstring

From: Date: Thu, 24 Feb 2005 06:20:28 +0000
Subject: note 50298 added to ref.mbstring
Groups: php.notes 
Request: Send a blank email to php-notes+get-85463@lists.php.net to get a copy of this message
PHP can input and output Unicode, but a little different from what Microsoft means: when Microsoft says "Unicode", it unexplicitly means little-endian UTF-16 with BOM(FF FE = chr(255).chr(254)), whereas PHP's "UTF-16" means big-endian with BOM. For this reason, PHP does not seem to be able to output Unicode CSV file for Microsoft Excel. Solving this problem is quite simple: just put BOM infront of UTF-16LE string. Example: $unicode_str_for_Excel = chr(255).chr(254).mb_convert_encoding( $utf8_str, 'UTF-16LE', 'UTF-8'); ---- Manual Page -- http://www.php.net/manual/en/ref.mbstring.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50298 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50298&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50298&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50298&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50298&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50298&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50298&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85463) next »