source: branches/comu-utf8/data/class/GC_MobileEmoji.php @ 15099

Revision 15099, 1.2 KB checked in by Yammy, 17 years ago (diff)

UTF-8変換済みファイルインポート
1.3.4ベース

Line 
1<?php
2
3/**
4 * 茵?ず?с??????腟究??絖???臀???????????絖??? (Shift JIS)
5 * ???????????????絖?????
6 */
7define('MOBILE_EMOJI_SUBSTITUTE', '');
8
9/**
10 * ?阪遣腴?????亀??絖????宴???????
11 */
12class GC_MobileEmoji {
13    /**
14     * 腟究??絖??帥?違???????c???∝??????絖??潟?若???????????
15     * output buffering ???潟?若?????????∽?
16     *
17     * @param string ?ュ??
18     * @return string ?阪??
19     */
20    function handler($buffer) {
21        $replace_callback = create_function('$matches', 'return GC_MobileEmoji::indexToCode($matches[1]);');
22        return preg_replace_callback('/\[emoji:(e?\d+)\]/', $replace_callback, $buffer);
23    }
24
25    /**
26     * 腟究??絖???垩??腟究??絖???茵??? Shift JIS ????絖??????????????
27     *
28     * @param string $index 腟究??絖???
29     * @return string 腟究??絖???茵??? Shift JIS ????絖?????菴?????
30     */
31    function indexToCode($index) {
32        $carrier = GC_MobileUserAgent::getCarrier();
33        if ($carrier === false) {
34            return MOBILE_EMOJI_SUBSTITUTE;
35        }
36
37        static $arrMap;
38        if (!isset($arrMap)) {
39            $arrMap = @include_once(dirname(__FILE__) . "/../include/mobile_emoji_map_$carrier.inc");
40        }
41
42        return isset($arrMap[$index]) ? $arrMap[$index] : MOBILE_EMOJI_SUBSTITUTE;
43    }
44}
45?>
Note: See TracBrowser for help on using the repository browser.