Shift-JIS



         


Shift-JIS (SJIS) is a character encoding for the Japanese language developed by Microsoft. As the name implies, it is based on the ISO-2022-JP (JIS) encoding, but with most byte values shifted to accommodate an additional 64 katakana characters in the range 0xA0 to 0xDF.

Unlike JIS, Shift-JIS requires an 8-bit medium for transmission. However, unlike competing 8-bit format EUC, Shift-JIS only guarantees that the first byte will be in the upper ASCII range; the value of the second byte can be either high or low. This makes reliable Shift-JIS detection difficult.

For a double-byte JIS sequence <math>j_1 j_2<math>, the transformation to the corresponding Shift-JIS bytes <math>s_1 s_2<math> is:

<math>33 \le j_1 \le 96 \Rightarrow s_1 = \frac{j_1 + 1}{2} + 112<math>
<math>97 \le j_1 \le 126 \Rightarrow s_1 = \frac{j_1 + 1}{2} + 176<math>
<math>j_1 \mbox{ is odd } \Rightarrow s_2 = j_2 + 31 + \operatorname{trunc}\left( \frac{j_2}{95} \right) <math>
<math>j_1 \mbox{ is even } \Rightarrow s_2 = j_2 + 126<math>

Shift-JIS retains a niche especially in Japanese web pages, but ISO-2022-JP and Unicode (particularly in its UTF-8 representation) are generally preferable.

[Top]




  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License