On 08/30/10 12:38, Hughes, Jim wrote:
> We have some DB2 systems using 16 bit Unicode.
>
> Would someone show us how to convert 16 bit Unicode to ascii or ebcdic?
>
Well, it depends on how much information you're willing to
lose.  If the Unicode information is primarily Hebrew, or worse,
a mix of Latin and Hebrew, there's no good conversion to either
ASCII or EBCDIC.  If you wish to consider UTF-8 a superset of
USASCII, but with variable-length character encoding, you can
follow the description in:

    http://en.wikipedia.org/wiki/UTF-8

(for example).  Should be an interesting pipeline to code.

If you don't care how much information you lose, just discard
the top 8 bits of each 16.

-- gil

Reply via email to