For faster navigation, this Iframe is preloading the Wikiwand page for Shift_JIS-2004.

Shift_JIS-2004

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と同一視されることもある。

構造

[編集]
第1バイト
0 1 2 3 4 5 6 7 8 9 A B C D E F
0
1
2 ! " # $ % & ' ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ ¥ ] ^ _
6 ` a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { | }
8
9
A
B ソ
C
D
E
F
第2バイト
0 1 2 3 4 5 6 7 8 9 A B C D E F
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では空き領域や未使用であった場所に文字が追加されている。

計算方法

[編集]

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

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

第1バイト(S1)は、以下による:

  1. m = 1 で 1 ≦ k ≦ 62 のとき, S1 = (k + 0x101) ÷ 2.
  2. m = 1 で 63 ≦ k ≦ 94 のとき, S1 = (k + 0x181) ÷ 2.
  3. m = 2 で, k = 1, 3, 4, 5, 8, 12, 13, 14, 15 のとき, S1 = (k + 0x1df) ÷ 2 - (k ÷ 8) × 3.
  4. m = 2 で, 78 ≦ k ≦ 94 のとき, S1 = (k + 0x19b) ÷ 2.

第2バイト(S2)は、以下による:

  1. k が奇数の場合:
    1. 1 ≦ t ≦ 63 のとき, S2 = t + 0x3f.
    2. 64 ≦ t ≦ 94 のとき, S2 = t + 0x40.
  2. k が偶数の場合, S2 = t + 0x9e.

Windows-31Jとの非互換

[編集]

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

Shift_JIS Windows-31J Shift_JIS-2004
JIS X 0208 JIS X 0208 JIS 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面で使用されており、併用できない。

関連項目

[編集]

脚注

[編集]
  1. ^ JIS X 0213の代表的な符号化方式 § Shift_JIS-2004”. 2019年4月27日閲覧。 Hexadecimal numbers in the source have been converted to decimal for display.

外部リンク

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
Shift_JIS-2004
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?