Re: DOS or Windows ASCII->Unicode converter

From: Wai-man Long, UEG/I18N, DTN 381-0262 ZKO3-3Y20 (longman@zk3.dec.com)
Date: Sun Jun 28 1998 - 20:19:11 EDT


Vik,

> Could someone please point me to a program for DOS or Windows that
> converts ASCII into Unicode, and hopefully one that does the reverse!

Converting ASCII into Unicode is very easy. ASCII is just a subset of
Unicode. By zero-extending the 8-bit byte containing the ASCII
character into a 16-bit data type, you will get the corresponding
Unicode equivalent. However, you may have to insert a byte-order mark
(U+FEFF) to aid the application to determine the correct endian-ness
of the Unicode data.

The reverse is more troublesome. You will certainly lose data if the
Unicode stream contain anything other than ASCII. If you are sure that
only ASCII data exist, you can just strip away the leading null byte.

-Longman
UNIX/I18N



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:40 EDT