Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Shift JIS
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Compatibility === Shift JIS is fully [[backward compatibility|backwards compatible]] with the {{nowrap|[[JIS X 0201]]}} [[single-byte encoding]], meaning that any valid {{nowrap|JIS X 0201}} string is also a valid Shift JIS string. Double-byte characters in {{nowrap|JIS X 0208}} need to be transformed in order to be encoded in Shift JIS. For a double-byte JIS X 0208 sequence <math>j_1 j_2</math>,{{efn|In JIS X 0208, ''j''<sub>1</sub> and ''j''<sub>2</sub> are each in the range 33 (0x21) to 126 (0x7e) inclusive (i.e., 7-bit character values excluding control characters (0–31 (0x1f) and 127 (0x7f)) and space).}} the transformation to the corresponding Shift JIS bytes <math>s_1 s_2</math> is: :<math>s_1 = \begin{cases} \left \lfloor \frac{j_1 + 1}{2} \right \rfloor + 112 & \mbox{if } 33 \le j_1 \le 94 \\ \left \lfloor \frac{j_1 + 1}{2} \right \rfloor + 176 & \mbox{if } 95 \le j_1 \le 126 \end{cases}</math> :<math>s_2 = \begin{cases} j_2 + 31 + \left \lfloor \frac{j_2}{96} \right \rfloor & \mbox{if } j_1 \mbox{ is odd }\\ j_2 + 126 & \mbox{if } j_1 \mbox{ is even } \end{cases}</math> The competing 8-bit format [[Extended Unix Code#EUC-JP|EUC-JP]], which does not support single-byte halfwidth katakana, allows for a cleaner and more direct conversion to and from JIS X 0208 [[code point]]s, as all high-bit-set bytes are parts of a double-byte character and all codes from ASCII range represent single-byte characters.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)