Posted By

sekihin on 09/04/09


Tagged

php


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


mb_convert_encoding


 / Published in: PHP
 

  1. <?php
  2. /* 内部文字エンコーディングからSJISに変換 */
  3. $str = mb_convert_encoding($str, "SJIS");
  4.  
  5. /* EUC-JPからUTF-7に変換 */
  6. $str = mb_convert_encoding($str, "UTF-7", "EUC-JP");
  7.  
  8. /* JIS, eucjp-win, sjis-winの順番で自動検出し、UCS-2LEに変換 */
  9. $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");
  10.  
  11. /* "auto" は、"ASCII,JIS,UTF-8,EUC-JP,SJIS" に展開される */
  12. $str = mb_convert_encoding($str, "EUC-JP", "auto");
  13. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: sekihin on February 22, 2010

mbconvertencoding($file, "EUC-JP", "SJIS, UTF-8, JIS, ASCII");

You need to login to post a comment.