Hello,

Mike Ayers has written:
Who said that Unicode is high-tech?
Here is a device to generate UTF-8 that employs traditional tools such as ASCII art, paper, scissors, glue, brain.

Attached is a similar device for converting Unicode scalar values to UTF-16 (UTF-16BE, that is, but you could easily add a final step to compute UTF-16LE, or to add a BOM).

Definitely, the world has longed for this, for years ;-)  Enjoy!

Cheers,
  Otto Stolz
��Avers: Print with a fixed-with font, such 
as Lucida Console,

and cut out.



%T%P%P%P%P%P%P%P%P%P%P%P%P%f%P%P%P%P%P%P%P%P%P%P%P%P%P%f%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W

%Q     U+0000 %Q W  X  Y  Z  %Q Otto s Magic 
Pocket Encoder     %Q

%Q     U+D7FF %Q !�  !�  !�  !�  %Q for  
UTF-16!"%T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%c

%Q       WXYZ %Q _  _  _  _  %Q             %Q 
   V!�vv %    V!�vv %Q

%_%%%%%%%%%%%%%k%%%%%%%%%%%%%%b Version 1.0 %Q 
   U!�uu %    U!�uu %Q

%Q     U+E000 %Q W  X  Y  Z  %Q �2004-07-02 %Q 
tt!�T    % tt!�T    %Q

%Q     U+FFFF %Q !�  !�  !�  !�  %Q             %Q 
   _!�__ %    _!�__ %Q

%Q       WXYZ %Q _  _  _  _  %Q             %Q 
%%%%%%%%%<%%%%%%%% %Q

%_%%%%%%%%%%%%%k%%%%%%%%%%%%%%Z%P%P%P%P%P%P%P%P%P%P%P%P%P%c 
   0!�00 % 13!�8!�20 %Q

%Q U%P00010000 %Q 31 2t tu uv % 31 3v Y  Z  %Q 
00!�1!�01 % 20!�9!�21 %Q

%Q U%P000FFFFF %Q !�  2_ __ __ % !�  3_ !�  !�  %Q 
01!�2!�02 % 21!�A!�22 %Q

%Q      TUVYZ %Q D  _  _  _  % D  _  _  _  %Q 
02!�3!�03 % 22!�B!�23 %Q

%_%%%%%%%%%%%%%k%%%%%%%%%%%%%%<%%%%%%%%%%%%%%b 
03!�4!�10 % 23!�C!�30 %Q

%Q U%P00100000 %Q 31 23 3u uv % 31 3v Y  Z  %Q 
10!�5!�11 % 30!�D!�31 %Q

%Q U%P0010FFFF %Q !�  !�  3_ __ % !�  3_ !�  !�  %Q 
11!�6!�12 % 31!�E!�32 %Q

%Q       UVYZ %Q D  B  _  _  % D  _  _  _  %Q 
12!�7!�13 % 32!�F!�33 %Q

%Z%P%P%P%P%P%P%P%P%P%P%P%P%i%P%P%P%P%P%P%P%P%P%P%P%P%P%g%P%P%P%P%P%P%P%P%P%P%P%P%P%i%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]





....:....1....:....2....:....3....:....4....:....5....:....6..





Revers: Cut out and paste on back of avers.



%T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W

%Q     Otto s Magic Pocket Encoder for 
UTF-16 Version 1.0     %Q

%Q     User s Manual     (inspired from Cima 
s UTF-8 MPE)     %Q

%`%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%c

%Q " Left column: min and max Unicode scalar 
values: pick the  %Q

%Q  row that applies to the code point to 
be converted.       %Q

%Q  T &Z mark the hexadecadic digits that 
have to be processed.%Q

%Q " Central column: work area to compute 
UTF-16BE code units. %Q

%Q " Right column: hexadecadic to quaternary 
conversion tables:%Q

%Q  !� for T to tt; !� for U/V to uu/VV (step 
1) and for step 2.%Q

%Q1. Convert each digit marked by T &V from 
hex to quat. Write %Q

%Q   quat digits on the undersores placed 
under letters t &v.  %Q

%Q2. Convert 2-digit quat numbers to hex 
digits or copy digits%Q

%Q   W &Z, as indicated, and write them  on 
the underscores on %Q

%Q   the next line. That s your UTF-16BE 
sequence in hex.     %Q

%Q!� Downwards arrows show shortcuts.        
                  %Q

%Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]



Enjoy.

Reply via email to