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
UTF-7
(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!
===Encoding=== First, an encoder must decide which characters to represent directly in ASCII form, which <code>+</code> have to be escaped as <code>+-</code>, and which to place in blocks of Unicode characters. The expansion cost of UTF-7 can be high: for example, the character sequence U+10FFFF U+0077 U+10FFFF is 9 bytes in UTF-8, but 17 bytes in UTF-7. (At worst, treating every codepoint as a sequence in its own right produces the maximum expansion of 5x, e.g. when encoding <code>@@</code> as <code>+AEA-+AEA-</code>.) Each Unicode sequence must be encoded using the following procedure, then surrounded by the appropriate delimiters. Using the Β£β (U+00A3 U+2020) character sequence as an example: {{ordered list |1= Express the character's Unicode numbers (UTF-16) in binary:{{unbulleted list |<samp>0x00A3 β 0000 0000 1010 0011</samp> |<samp>0x2020 β 0010 0000 0010 0000</samp>}} |2= Concatenate the binary sequences:<br /> <samp>0000 0000 1010 0011 and 0010 0000 0010 0000 β 0000 0000 1010 0011 0010 0000 0010 0000</samp> |3= Regroup the binary into groups of six bits, starting from the left:<br /> <samp>0000 0000 1010 0011 0010 0000 0010 0000 β 000000 001010 001100 100000 001000 00</samp> |4= If the last group has fewer than six bits, add trailing zeros:<br /> <samp>000000 001010 001100 100000 001000 00 β 000000 001010 001100 100000 001000 000000</samp> |5= Replace each group of six bits with a respective Base64 code:<br /> <samp>000000 001010 001100 100000 001000 000000 β AKMgIA</samp> }}
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)