Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
UTF-16
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
=== Examples === To encode U+10437 (π·) to UTF-16: * Subtract 0x10000 from the code point, leaving 0x0437. * For the high surrogate, shift right by 10 (divide by 0x400), then add 0xD800, resulting in 0x0001 + 0xD800 = 0xD801. * For the low surrogate, take the low 10 bits (remainder of dividing by 0x400), then add 0xDC00, resulting in 0x0037 + 0xDC00 = 0xDC37. To decode U+10437 (π·) from UTF-16: * Take the high surrogate (0xD801) and subtract 0xD800, then multiply by 0x400, resulting in 0x0001 Γ 0x400 = 0x0400. * Take the low surrogate (0xDC37) and subtract 0xDC00, resulting in 0x37. * Add these two results together (0x0437), and finally add 0x10000 to get the final code point, 0x10437. The following table summarizes this conversion, as well as others. The colors indicate how bits from the code point are distributed among the UTF-16 bytes. Additional bits added by the UTF-16 encoding process are shown in black. {| class="wikitable" |- !colspan=2|Character ! Binary code point ! Binary UTF-16 ! UTF-16 hex<br />code units ! UTF-16BE<br />hex bytes ! UTF-16LE<br />hex bytes |- |[[$]] || <code>U+0024</code> |align=right|<code>{{Font color|#2196f3|0000 0000 0010 0100}}</code> |align=right|<code>{{Font color|#2196f3|0000 0000 0010 0100}}</code> |align=right|<code>{{Font color|#2196f3|0024}}</code> |align=right|<code>{{Font color|#2196f3|00 24}}</code> |align=right|<code>{{Font color|#2196f3|24 00}}</code> |- |[[Euro sign|β¬]] || <code>U+20AC</code> |align=right|<code>{{Font color|#2196f3|0010 0000 1010 1100}}</code> |align=right|<code>{{Font color|#2196f3|0010 0000 1010 1100}}</code> |align=right|<code>{{Font color|#2196f3|20AC}}</code> |align=right|<code>{{Font color|#2196f3|20 AC}}</code> |align=right|<code>{{Font color|#2196f3|AC 20}}</code> |- |[[π·]] || <code>U+10437</code> |align=right|<code>{{Font color|#e91e63|0001 0000 01}}{{Font color|#2196f3|00 0011 0111}}</code> |align=right|<code>1101 10{{Font color|#e91e63|00 0000 0001}} 1101 11{{Font color|#2196f3|00 0011 0111}}</code> |align=right|<code>{{Font color|#e91e63|D801}} {{Font color|#2196f3|DC37}}</code> |align=right|<code>{{Font color|#e91e63|D8 01}} {{Font color|#2196f3|DC 37}}</code> |align=right|<code>{{Font color|#e91e63|01 D8}} {{Font color|#2196f3|37 DC}}</code> |- |[[wikt:π€’|π€’]] || <code>U+24B62</code> |align=right|<code>{{Font color|#e91e63|0010 0100 10}}{{Font color|#2196f3|11 0110 0010}}</code> |align=right|<code>1101 10{{Font color|#e91e63|00 0101 0010}} 1101 11{{Font color|#2196f3|11 0110 0010}}</code> |align=right|<code>{{Font color|#e91e63|D852}} {{Font color|#2196f3|DF62}}</code> |align=right|<code>{{Font color|#e91e63|D8 52}} {{Font color|#2196f3|DF 62}}</code> |align=right|<code>{{Font color|#e91e63|52 D8}} {{Font color|#2196f3|62 DF}}</code> |} {{anchor|UTF-16LE|UTF-16BE}}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
UTF-16
(section)
Add topic