#1302 closed enhancement (fixed)
絵文字のDB格納時のコード体系を変える
Reported by: | kunitada | Owned by: | ebihara |
---|---|---|---|
Priority: | blocker | Milestone: | OpenPNE2.10alpha2 |
Component: | pne-ktai | Version: | |
Keywords: | hidden | Cc: |
Description (last modified by )
絵文字のDB格納時のコード体系を変える
https://trac.openpne.jp/svn/OpenPNE_specification/trunk/2.10/20070918_【2.10】絵文字変換表.xls
の「OpenPNE」列参照のこと。
Change History (9)
comment:1 Changed 13 years ago by
Owner: | changed from nobody to ebihara |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
r4130で対応しました。
ファイル内絵文字表記のコンバートに使用したスクリプトは以下です。
<?php // php emoji_num_converter.php [filename] [output] // filename : 変換したい文字列の入ったファイル // output : 出力したいファイル $filename = $argv[1]; $output = $argv[2]; $old_str = file($filename); $new_str = ''; foreach ($old_str as $value) { $new_str .= preg_replace_callback('/\[([si]):([0-9]+)\]/', '_callback_emoji_num_replace', $value); } file_put_contents($output, $new_str); function _callback_emoji_num_replace($matches) { $carrier = $matches[1]; $code = (int)$matches[2]; if ($carrier == 'i' && $code <= 176) { $_def = 0; } elseif ($carrier == 'i') { $_def = 824; } if ($carrier == 's') { if ($code <= 90) { $_def = 0; } elseif ($code >= 101 && $code <= 190) { $_def = 10; } elseif ($code >= 201 && $code <= 290) { $_def = 20; } elseif ($code >= 301 && $code <= 377) { $_def = 30; } elseif ($code >= 401 && $code <= 476) { $_def = 53; } elseif ($code >= 501 && $code <= 562) { $_def = 77; } } return '[' . $carrier . ':' . ($code - $_def) . ']'; } ?>
comment:3 Changed 13 years ago by
Keywords: | 確認中 added |
---|---|
Owner: | changed from ebihara to ogawa |
Status: | assigned → new |
ご確認ください。
comment:4 Changed 13 years ago by
関連で、以下のチケットを作りました。
#1307:20070918_【2.10】絵文字変換表.xls のエクセルから、PHPコードの絵文字変換テーブルを出力できるようにする
comment:5 Changed 13 years ago by
Keywords: | 確認中 removed |
---|---|
Owner: | changed from ogawa to ebihara |
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 Changed 13 years ago by
Milestone: | OpenPNE2.10beta1 → OpenPNE2.10alpha2 |
---|
alpha2リリースにつき、Milestoneを変更
comment:8 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Summary: | 絵文字のDB格納字のコード体系を変える → 絵文字のDB格納時のコード体系を変える |
comment:9 Changed 13 years ago by
Keywords: | hidden added |
---|
Note: See
TracTickets for help on using
tickets.
やります