View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dario de Judicibus Dario de Judicibus is offline
external usenet poster
 
Posts: 8
Default A macro to export a sheet as UTF8 encoded Unicode file

I also think that Unicode to UTF8 conversion might be done directly in VBA.
Algorith should not be complicated. Rules a

ISO 10646 range covered UTF-8 representation
----------------------- --------------------
Bits Hex Min Hex Max Byte Sequence in Binary
7 00000000 0000007f 0vvvvvvv
11 00000080 000007FF 110vvvvv 10vvvvvv
16 00000800 0000FFFF 1110vvvv 10vvvvvv 10vvvvvv


That is, any character from 0000 [0000 0000 0000 0000] to 007F [0000 0000
0111 11111] becomes
0bbb bbbb where b is 0 or 1, any character from 0080 [0000 0000 0000 0000]
to 07FFF [0000 0111 1111 1111] becomes 110bbbbb 10bbbbbb, and so forth.

DdJ