Re: Need encoding conversion routines

From: askq1 askq1 (
Date: Fri Mar 14 2003 - 07:16:37 EST

  • Next message: Dominikus Scherkl: "RE: per-character "stories" in a database"

    >From: "Pim Blokland" <>
    >To: "Unicode mailing list" <>
    >Subject: Re: Need encoding conversion routines
    >Date: Fri, 14 Mar 2003 12:30:44 +0100
    >askq1 askq1 schreef:
    > > In particular I need source code (or some way) for following
    > > - Convert Unicode code-point to UTF8 encoding and vice-versa.
    > > - Convert Unicode code-point to UCS2 encoding and vice-versa.
    > > - Convert Unicode code-point to UTF16 encoding and vice-versa.
    >Ahem. Unicode *IS* UTF-8, UTF-16 and UCS-2. For instance, codepoint
    >U+4321 has the value (hex) 4321, which is defined as its Unicode
    >value. This is the same in any encoding. So I'm not sure what you
    >want. If the C routines at
    > don't do it for you,
    >which conversion do you need? LE byte order to BE and back?
    >Canonical decomposing? Fallback character substitutions? BOM
    >insertion? What?

    Yes I agree to what you are saying above. Let em explain what I want.
    Character U+4321 is the unicode code-point but to store this character into
    a file we need to use a certain encoding format.
    e.g. There must be some algorithm to find *the sequence of bytes* that
    represent this character into *UTF8 encoding*. Similar algorithms must be
    there for UTF16 and UCS2 encodings, I want C implementation of such

    ~ K.

    >Pim Blokland

    Cricket - World Cup 2003
    News, Views and Match Reports.

    This archive was generated by hypermail 2.1.5 : Fri Mar 14 2003 - 08:00:54 EST