Shift_JIS-2004
[Wikipedia|▼Menu]

Shift_JIS-2004は、日本の文字を符号化するのに使われる文字コードである。JIS X 0213の符号化方式のひとつである。JIS X 0213:2004の附属書1で定義されている。

JIS X 0208の符号化方式のひとつであるShift_JISと同様に、JIS X 0201の1バイト文字とJIS X 0213の2バイト文字とを組み合わせて運用する符号化方式である。Shift_JISの上位互換となっている。

JIS X 0213には94文字×94文字の面が2つあるが、JIS X 0208の上位互換である第1面はShift_JISの第1バイト0xEFまでの範囲に収まる。面区点番号からShift_JIS-2004のバイト値を求める際、この範囲までの計算方法はShift_JISと同じである。Shift_JIS-2004ではさらに、第2面 (第4水準漢字) を収録するために、第1バイト0xF0から0xFCまでの範囲を用いる。2面で、区番号が1, 3, 4, 5, 8, 12, 13, 14, 15 のときは、第1バイトは (区番号 + 0x1DF) ÷ 2 ? (区番号 ÷ 8) × 3 となる。区番号が78から94までのときは、第1バイトは (区番号 + 0x19B) ÷ 2 となる。こうしてJIS X 0213の11,233文字全てを2バイトで表現する。

なお、JIS X 0213の初版 (2000年) では、この符号化方式はShift_JISX0213と命名されていた。2004年改正で追加されたUCS互換漢字10文字の有無だけが異なるが、大きな違いではないためShift_JIS-2004と同一視されることもある。
構造.mw-parser-output .hlist ul,.mw-parser-output .hlist ol{padding-left:0}.mw-parser-output .hlist li,.mw-parser-output .hlist dd,.mw-parser-output .hlist dt{margin-right:0;display:inline-block;white-space:nowrap}.mw-parser-output .hlist dt:after,.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{white-space:normal}.mw-parser-output .hlist li:after,.mw-parser-output .hlist dd:after{content:" ・\a0 ";font-weight:bold}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist-pipe dd:after,.mw-parser-output .hlist-pipe li:after{content:" |\a0 ";font-weight:normal}.mw-parser-output .hlist-hyphen dd:after,.mw-parser-output .hlist-hyphen li:after{content:" -\a0 ";font-weight:normal}.mw-parser-output .hlist-comma dd:after,.mw-parser-output .hlist-comma li:after{content:"、";font-weight:normal}.mw-parser-output .hlist-slash dd:after,.mw-parser-output .hlist-slash li:after{content:" /\a0 ";font-weight:normal}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")\a0 ";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)" ";white-space:nowrap}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)" "}.mw-parser-output .navbar{display:inline;font-size:75%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:88%}.mw-parser-output .navbox .navbar{display:block;font-size:88%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}








第1バイト0123456789ABCDEF
0????????????????
1????????????????
2?!"#$%&'()*+,-./
30123456789:;<=>?
4@ABCDEFGHIJKLMNO
5PQRSTUVWXYZ[\]^_
6`abcdefghijklmno
7pqrstuvwxyz{|}??
8
9
A。「」、・ヲァィゥェォャュョッ
Bーアイウエオカキクケコサシスセソ
Cタチツテトナニヌネノハヒフヘホマ
Dミムメモヤユヨラリルレロワン゙゚
E
F

第2バイト0123456789ABCDEF
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F

 

ASCII制御文字
ASCIIと同一の文字
ASCIIと異なる文字
半角カナ
2バイト文字の第1バイト
2バイト文字の第2バイト(区番号が奇数の場合)
2バイト文字の第2バイト(区番号が偶数の場合)
未使用

Shift_JISでは空き領域や未使用であった場所に文字が追加されている。
計算方法 s 1 = { ⌊ k + 257 2 ⌋ if  m = 1  and  1 ≤ k ≤ 62 ⌊ k + 385 2 ⌋ if  m = 1  and  63 ≤ k ≤ 94 ⌊ k + 479 2 ⌋ − ⌊ k 8 ⌋ × 3 if  m = 2  and  k = 1 , 3 , 4 , 5 , 8 , 12 , 13 , 14 , 15 ⌊ k + 411 2 ⌋ if  m = 2  and  78 ≤ k ≤ 94 {\displaystyle s_{1}={\begin{cases}\left\lfloor {\frac {k+257}{2}}\right\rfloor &{\mbox{if }}m=1{\mbox{ and }}1\leq k\leq 62\\\left\lfloor {\frac {k+385}{2}}\right\rfloor &{\mbox{if }}m=1{\mbox{ and }}63\leq k\leq 94\\\left\lfloor {\frac {k+479}{2}}\right\rfloor -\left\lfloor {\frac {k}{8}}\right\rfloor \times 3&{\mbox{if }}m=2{\mbox{ and }}k=1,3,4,5,8,12,13,14,15\\\left\lfloor {\frac {k+411}{2}}\right\rfloor &{\mbox{if }}m=2{\mbox{ and }}78\leq k\leq 94\end{cases}}} s 2 = { t + 63 if  k  is odd and  1 ≤ t ≤ 63 t + 64 if  k  is odd and  64 ≤ t ≤ 94 t + 158 if  k  is even  {\displaystyle s_{2}={\begin{cases}t+63&{\mbox{if }}k{\mbox{ is odd and }}1\leq t\leq 63\\t+64&{\mbox{if }}k{\mbox{ is odd and }}64\leq t\leq 94\\t+158&{\mbox{if }}k{\mbox{ is even }}\end{cases}}}

面区点番号からShift_JIS-2004の第1・第2バイトは以下の通り求められます。[1]

面番号を m、区番号を k、点番号を t とする。また、記号 ÷ は整数除算 (小数点以下切捨て)を表す。

第1バイト(S1)は、以下による:
m = 1 で 1 ≦ k ≦ 62 のとき, S1 = (k + 0x101) ÷ 2.

m = 1 で 63 ≦ k ≦ 94 のとき, S1 = (k + 0x181) ÷ 2.

m = 2 で, k = 1, 3, 4, 5, 8, 12, 13, 14, 15 のとき, S1 = (k + 0x1df) ÷ 2 ? (k ÷ 8) × 3.

m = 2 で, 78 ≦ k ≦ 94 のとき, S1 = (k + 0x19b) ÷ 2.

第2バイト(S2)は、以下による:
k が奇数の場合:
1 ≦ t ≦ 63 のとき, S2 = t + 0x3f.

64 ≦ t ≦ 94 のとき, S2 = t + 0x40.


k が偶数の場合, S2 = t + 0x9e.

Windows-31Jとの非互換

Shift_JIS-2004は、Windows-31Jとは併用できない符号化方式である。

Shift_JISWindows-31JShift_JIS-2004
JIS X 0208JIS X 0208JIS X 0213に含まれる。
未定義NEC特殊文字(0x8740 - 0x879C) JIS X 0213に含まれる。
ただし、重複分は削除されている(「≒」「≡」「∫」「Σ」「√」「⊥」「∠」「∵」「∩」「∪」)。
「 (N-ARY SUMMATION)」はギリシャ大文字シグマ「Σ」で代用。
また、同領域に追加されている文字がある(「?」「?」)。
未定義NEC選定IBM拡張文字(0xED40 - 0xEEFC)は、JIS X 0213の1面で使用されており、併用できない。
未定義ユーザー定義外字領域(0xF040 - 0xF9FC)は、JIS X 0213の2面で使用されており、併用できない。
未定義IBM拡張文字(0xFA40 - 0xFC4B)は、JIS X 0213の2面で使用されており、併用できない。

関連項目

Shift_JIS


次ページ
記事の検索
おまかせリスト
▼オプションを表示
ブックマーク登録
mixiチェック!
Twitterに投稿
オプション/リンク一覧
話題のニュース
列車運行情報
暇つぶしWikipedia

Size:14 KB
出典: フリー百科事典『ウィキペディア(Wikipedia)
担当:undef