2 ini_set('error_reporting', E_ALL);
\r
3 require_once '../MobilePictogramConverter.php';
\r
5 header("Content-Type: text/html; charset=UTF-8");
\r
8 $str = "あ".pack("H*", "EE8081EE8082EE8083EE8084EE8085EE8086")."い";
\r
9 $option = MPC_FROM_OPTION_RAW;
\r
11 //$str = 'あ
\e$G!
\ f\e$G"
\ fい
\e$E"
\ f\e$E#
\ f\e$E%
\ f\e$E#
\ fう';
\r
12 //$option = MPC_FROM_OPTION_WEB;
\r
14 //$str = 'あ<img src="../img/s/18209.gif" alt="" border="0" width="15" height="15" /><img src="../img/s/18210.gif" alt="" border="0" width="15" height="15" />い<img src="../img/s/17698.gif" alt="" border="0" width="15" height="15" /><img src="../img/s/17699.gif" alt="" border="0" width="15" height="15" /><img src="../img/s/17701.gif" alt="" border="0" width="15" height="15" /><img src="../img/s/17699.gif" alt="" border="0" width="15" height="15" />う';
\r
15 //$option = MPC_FROM_OPTION_IMG;
\r
17 $mpc =& MobilePictogramConverter::factory($str, MPC_FROM_SOFTBANK, MPC_FROM_CHARSET_UTF8, $option);
\r
18 if (is_object($mpc) == false) {
\r
21 $mpc->setImagePath("../img/");
\r
25 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
\r
26 <title>SoftBank絵文字からの変換 (UTF-8)</title>
\r
30 /* ユーザーエージェントからの自動変換 */
\r
31 echo "Auto :".$mpc->autoConvert()."<br />\r\n";
\r
33 echo 'Delete : '.$mpc->Except().'<br />'."\r\n";
\r
34 /* 文字列に含まれている絵文字の数 */
\r
35 echo 'Count : '.$mpc->Count().'<br />'."\r\n";
\r
37 /* モバイル表示用(Web入力コード) */
\r
38 //echo 'SoftBank : '.$mpc->Convert(MPC_TO_SOFTBANK, MPC_TO_OPTION_WEB).'<br />'."\r\n";
\r
39 //echo 'FOMA : ' .$mpc->Convert(MPC_TO_FOMA , MPC_TO_OPTION_WEB).'<br />'."\r\n";
\r
40 //echo 'EZweb : ' .$mpc->Convert(MPC_TO_EZWEB , MPC_TO_OPTION_WEB).'<br />'."\r\n";
\r
42 /* モバイル表示用(バイナリコード) */
\r
43 //echo 'SoftBank : '.$mpc->Convert(MPC_TO_SOFTBANK, MPC_TO_OPTION_RAW).'<br />'."\r\n";
\r
44 //echo 'FOMA : ' .$mpc->Convert(MPC_TO_FOMA , MPC_TO_OPTION_RAW).'<br />'."\r\n";
\r
45 //echo 'EZweb : ' .$mpc->Convert(MPC_TO_EZWEB , MPC_TO_OPTION_RAW).'<br />'."\r\n";
\r
48 //echo 'SoftBank : '.$mpc->Convert(MPC_TO_SOFTBANK, MPC_TO_OPTION_IMG).'<br />'."\r\n";
\r
49 //echo 'FOMA : ' .$mpc->Convert(MPC_TO_FOMA , MPC_TO_OPTION_IMG).'<br />'."\r\n";
\r
50 //echo 'EZweb : ' .$mpc->Convert(MPC_TO_EZWEB , MPC_TO_OPTION_IMG).'<br />'."\r\n";
\r