| 132 | | Mapping for NTT DoCoMo i-mode handsets. Pictograms are mapped in |
| 133 | | Shift_JIS private area and Unicode private area. The conversion rule |
| 134 | | is equivalent to that of cp932. |
| 135 | | |
| 136 | | For example, C<U+E64E> is I<Fine> character (or I<The Sun>) and is |
| 137 | | encoded as C<\xF8\x9F> in this encoding. |
| 138 | | |
| 139 | | This encoding is a subset of cp932 encoding, but has a reverse mapping |
| 140 | | from KDDI/AU Unicode private area characters to DoCoMo pictogram |
| 141 | | encodings. For example, |
| 142 | | |
| 143 | | my $kddi = "\xf6\x59"; # [!] in KDDI/AU |
| | 132 | NTT DoCoMo の i-mode 端末用のマッピング。絵文字は Shift_JIS の私的利用領域でエンコードされ、Unicode の私的利用領域にマッピングされます。この際の変換ルールは CP932 と同様です。 |
| | 133 | |
| | 134 | 例えば、C<U+E64E> は I<晴れ> の絵文字で、このエンコーディングでは C<\xF8\X9F> にエンコードされます。 |
| | 135 | |
| | 136 | このエンコーディングは CP932 の完全なサブセットですが、KDDI/AU の絵文字をマップした Unicode 私的利用領域からDoCoMo 絵文字へのマッピングもサポートしています。例えば、 |
| | 137 | |
| | 138 | my $kddi = "\xf6\x59"; # KDDI/AU の SJIS で [!] |
| 151 | | Escape sequence based Shift_JIS encoding for SoftBank |
| 152 | | pictograms. Decoding algorithm is not based on an ucm file, but a perl |
| 153 | | code. |
| 154 | | |
| 155 | | I<x-sjis-vodafone> is an alias. |
| 156 | | |
| 157 | | For example, C<U+E001> is I<A Boy> character and is encoded |
| 158 | | as C<\x1b$G!\x0f> in this encoding (C<\x1b$G> is the beginning of |
| 159 | | escape sequence and C<\x0f> is the end.) |
| | 146 | SoftBank 絵文字をエンコードするためのエスケープシーケンスがベースの Shift_JIS エンコーディングです。エンコード・デコードのアルゴリズムは UCM ファイルではなく、Perl コードで実装されています。 |
| | 147 | |
| | 148 | I<x-sjis-vodafone> をエイリアスとして利用できます。 |
| | 149 | |
| | 150 | 例えば、C<U+E001> は I<男の子> の絵文字で、このエンコーディングでは C<\x1b$G!\x0f> のようにエンコードされます。(C<\x1b$G> がエスケープシーケンス開始、C<\x0f> が終了を示す) |
| 163 | | Maps Unicode private area characters to Shift_JIS private area (Gaiji) |
| 164 | | characters. This encoding is used in 3GC phones when you input |
| 165 | | pictogram charaters in a web form on Shift_JIS pages and submit. |
| 166 | | Handsets also can decode these encodings and display pictogram characters. |
| 167 | | |
| 168 | | I<x-sjis-vodafone-auto> is an alias. |
| 169 | | |
| 170 | | The private area mapping seems similar to CP932 but with a bit of |
| 171 | | offset. |
| 172 | | |
| 173 | | For example, U<+E001> is I<A Boy> character (same as |
| 174 | | I<x-sjis-softbank>) and is encoded as I<\xF9\x41>. |
| | 154 | Unicode 私的利用領域にマップされた SoftBank 絵文字と Shift_JIS 私的利用領域(外字)をマッピングします。このエンコーディングは 3GC 端末を利用して Shift_JIS でエンコードされた Web フォームに絵文字を入力し、サブミットしたときに送信されるエンコードです。実機端末では HTML 内にこのエンコーディングでエンコードした絵文字をデコードして表示できることが確認されています。 |
| | 155 | |
| | 156 | I<x-sjis-vodafone-auto> をエイリアスとして利用できます。 |
| | 157 | |
| | 158 | Shift_JIS 私的利用領域のマッピングは CP932 に似ていますが、若干ずれている場所があります。 |
| | 159 | |
| | 160 | 例えば、 U<+E001> は I<男の子> 絵文字 (I<x-sjis-softbank> と同様) で、このエンコーディングでは I<\xF9\x41> とエンコードされます。 |
| 178 | | Mapping for KDDI/AU pictograms. It's based on cp932 (I guess) but |
| 179 | | there are more private characters that are not included in CP932.TXT. |
| 180 | | |
| 181 | | For example, I<U+E481> is I<!> (the exclamation) character and is |
| 182 | | encoded as I<\xF6\x59> (same as cp932). I<U+EB88> is I<Angry> |
| 183 | | character and is encoded in I<\xF4\x8D> while cp932 doesn't have a map |
| 184 | | for it. |
| 185 | | |
| 186 | | I<x-sjis-ezweb> is an alias. |
| | 164 | KDDI/AU 絵文字のマッピング。(おそらく)CP932 をベースにしていますが、CP932.TXT には含まれない私的利用領域文字を多く含んでいます。 |
| | 165 | |
| | 166 | 例えば、I<U+E481> は I<!> (ビックリマーク)絵文字で、このエンコーディングでは I<\xF6\x59> のようにエンコードされ、これは CP932 と同様です。 I<U+EB88> は I<怒る> 絵文字で、I<\xF4\x8D> のようにエンコードされますが、CP932 はこの文字に対するマッピングを含んでいません。 |
| | 167 | |
| | 168 | このエンコーディングに含まれる一部の絵文字は、SoftBank の私的利用領域と重複しています。 |
| | 169 | |
| | 170 | I<x-sjis-ezweb> をエイリアスとして利用できます。 |
| 190 | | Mapping for KDDI/AU pictograms, based on handset's internal Shift_JIS |
| 191 | | to UTF-8 translations and vice verca. When you input some pictogram |
| 192 | | characters in a web form on a UTF-8 page and submit them, this mapping |
| 193 | | is used (instead of CP932 based I<x-sjis-kddi>) to represent the |
| 194 | | pictogram characters. |
| 195 | | |
| 196 | | I<x-sjis-kddi-auto> and I<x-sjis-kddi> shares Unicode to encoding |
| 197 | | mapping each other and hence round-trip safe, which means: |
| | 174 | KDDI/AU 絵文字のマッピングで、端末内部の Shift_JIS - UTF-8 間の変換表を元にしています。 |
| | 175 | |
| | 176 | KDDI端末から、UTF-8 ページ内の Web フォームに絵文字を入力して送信した場合、x-sjis-kddi でマップされる Unicode 私的利用領域 (CP932 ベース) とは異なる領域(通称 裏KDDI Unicode)が利用されます。x-sjis-kddi-auto は、この領域と、KDDI 端末の Shift_JIS 外字バイト列とをマッピングしたものです。 |
| | 177 | |
| | 178 | I<x-sjis-kddi-auto> と I<x-sjis-kddi> は Unicode 外字領域のコードポイントを相互に共有しているため、ラウンドトリップすることが可能です。つまり、 |
| 200 | | decode("x-sjis-kddi", $bytes); # \x{E481} |
| 201 | | decode("x-sjis-kddi-auto", $bytes); # \x{EF59} |
| 202 | | encode("x-sjis-kddi", "\x{EF59}"); # same as $bytes |
| 203 | | encode("x-sjis-kddi-auto", "\x{E481}"); # same as $bytes |
| 204 | | |
| 205 | | C<x-sjis-ezweb-auto> is an alias. |
| | 181 | decode("x-sjis-kddi", $bytes); # \x{E481} -- CP932 ベースのマッピング |
| | 182 | decode("x-sjis-kddi-auto", $bytes); # \x{EF59} -- UTF-8 端末変換と同様のマッピング |
| | 183 | encode("x-sjis-kddi", "\x{EF59}"); # $bytes と同じ |
| | 184 | encode("x-sjis-kddi-auto", "\x{E481}"); # $bytes と同じ |
| | 185 | |
| | 186 | このようにエンコードする際は、どちらを利用しても同じ結果が得られるため、UTF-8 端末からの入力をそのままデータベースに保存するようなケースでは I<x-sjis-kddi-auto> を利用するとよいでしょう。I<x-sjis-kddi> とは異なり、このエンコーディングに含まれる絵文字は、SoftBank の私的利用領域と重複しません。 |
| | 187 | |
| | 188 | C<x-sjis-ezweb-auto> をエイリアスとして利用できます。 |
| 209 | | Encoding used to encode KDDI/AU pictogram characters in Email. It's |
| 210 | | based on I<iso-2022-jp> which is still a de-facto standard encoding |
| 211 | | when we sned emails. |
| 212 | | |
| 213 | | Actually most KDDI/AU cellphones can receive emails encoded in |
| 214 | | Shift_JIS, so you can just use I<x-sjis-kddi> to encode the pictogram |
| 215 | | characters. This encoding might be still needed to decode incoming |
| 216 | | emails sent from KDDI/AU phones containing pictogram characters. |
| 217 | | |
| 218 | | C<x-iso-2022-jp-ezweb> is an alias. |
| | 192 | KDDI/AU の絵文字を Email 内で利用する際のエンコーディング。日本語でメールを送信する際、依然としてデファクトスタンダードである I<iso-2022-jp> をベースにしています。 |
| | 193 | |
| | 194 | 実際には、ほとんどの KDDI/AU 携帯電話端末は Shift_JIS でエンコードされた Email を受信することができるため、I<x-sjis-kddi> (または -auto)を利用してメールを送信すれば問題はないでしょう。このエンコーディングは携帯端末から送られた絵文字を含むメールを受信し、デコードする際に必要になります。 |
| | 195 | |
| | 196 | C<x-iso-2022-jp-ezweb> をエイリアスとして利用できます。 |
| | 197 | |
| | 198 | =item x-iso-2022-jp-kddi-auto |
| | 199 | |
| | 200 | I<x-iso-2022-jp-kddi> と同様ですが、絵文字を 裏KDDI Unicode 領域にデコードします。 |
| 227 | | x-utf8-* encodings are encodings to display subset of Unicode |
| 228 | | characters in UTF-8 format. The subset is set to characters in: |
| 229 | | |
| 230 | | cp932 + x-sjis-{career} + (characters mapped from other careers) |
| 231 | | |
| 232 | | When encoding Unicode characters, it automatically does conversion |
| 233 | | from other career based encodings. |
| 234 | | |
| 235 | | For example, |
| 236 | | |
| 237 | | # KDDI 'Sunny' character in UTF-8 |
| | 208 | これらのエンコーディングは、Unicode 私的利用領域にある各キャリアの絵文字を相互変換しながら UTF-8 互換のエンコーディングにエンコードするのに使用します。utf-8 という名前がついていますが、実際にはすべての Unicode 文字をエンコードするわけではなく、サブセットとして、 |
| | 209 | |
| | 210 | cp932 + x-sjis-{キャリア} + (他キャリアからのマッピング) |
| | 211 | |
| | 212 | に含まれる文字セットをエンコードし、他キャリアの分は自動で自キャリアの対応する絵文字に変換します。 |
| | 213 | |
| | 214 | 例えば、 |
| | 215 | |
| | 216 | # UTF-8 で KDDI の "晴れ" 絵文字 |
| 240 | | # Now $bytes has DoCoMo 'Sunny' character in UTF-8 |
| 241 | | |
| 242 | | These encodings are round-trip safe, but note that they're still |
| 243 | | subsets of UTF-8 and can't encode/decode characters outside cp932 and |
| 244 | | Japanese mobile characters. You can use Encode fallbacks like |
| 245 | | C<FB_XMLCREF> or custom fallback to display outside characters. |
| 246 | | |
| 247 | | See |
| 248 | | L<http://mobilehacker.g.hatena.ne.jp/tokuhirom/20080116/1200501202> |
| 249 | | and L<http://mobilehacker.g.hatena.ne.jp/tomi-ru/20071116/1195186373> |
| 250 | | for details. |
| | 219 | # $bytes は DoCoMo の "晴れ" 絵文字を UTF-8 でエンコードしたもの |
| | 220 | |
| | 221 | これらのエンコードは基本的にラウンドトリップ可能ですが、UTF-8のサブセットであるため、CP932 および携帯絵文字以外の文字をエンコード・デコードすることはできません。また、各キャリア間で変換不可能な文字についても対応するマッピングが存在しない場合がありますので、C<FB_XMLCREF> などの fallback や、カスタムコールバックなどを利用して代替文字を表示する必要があります。 |
| | 222 | |
| | 223 | 詳しくは L<http://mobilehacker.g.hatena.ne.jp/tokuhirom/20080116/1200501202> |
| | 224 | や L<http://mobilehacker.g.hatena.ne.jp/tomi-ru/20071116/1195186373> などを参照。 |
| 279 | | As of 0.07, this module now uses I<x-sjis-*> as its encoding names. It |
| 280 | | still supports the old I<shift_jis-*> aliases though. I'm planning to |
| 281 | | deprecate them sometime in the future release. |
| 282 | | |
| 283 | | =head1 NOTES |
| 284 | | |
| 285 | | =over 4 |
| 286 | | |
| 287 | | =item * |
| 288 | | |
| 289 | | Pictogram characters are defined to be round-trip safe. However, they |
| 290 | | use Unicode Private Area for such characters, that means you'll have |
| 291 | | interoperability issues, which this module doesn't try yet to solve |
| 292 | | completely. We have a partial support for roundtrip (automatic |
| 293 | | conversion) between I<x-sjis-imode> and I<x-sjis-kddi>. |
| 294 | | |
| 295 | | =item * |
| 296 | | |
| 297 | | As of version 0.04, this module tries to do auto-conversion of KDDI/AU |
| 298 | | and NTT-DoCoMo pictogram characters. Supporting SoftBank characters |
| 299 | | are still left TODO. |
| 300 | | |
| 301 | | =back |
| 302 | | |
| 303 | | =head1 TODO |
| 304 | | |
| 305 | | =over 4 |
| 306 | | |
| 307 | | =item * |
| 308 | | |
| 309 | | Implement all merged C<x-sjis-mobile-jp> encoding. |
| 310 | | |
| 311 | | =back |
| | 250 | バージョン 0.07 から、モジュールで利用するエンコーディング名を I<x-sjis-*> のように変更しました。以前の I<shift_jis-*> というエイリアスも残してありますが、将来のリリースで削除される予定です。 |