Re: Need encoding conversion routines

From: askq1 askq1 (askq1@hotmail.com)
Date: Fri Mar 14 2003 - 07:16:37 EST

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

    >From: "Pim Blokland" <pblokland@planet.nl>
    >To: "Unicode mailing list" <unicode@unicode.org>
    >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
    >requirements:
    > > - 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
    >http://www.unicode.org/Public/PROGRAMS/CVTUTF/ 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
    algorithms.

    Thanks,
    ~ K.

    >Pim Blokland

    _________________________________________________________________
    Cricket - World Cup 2003 http://server1.msn.co.in/msnspecials/worldcup03/
    News, Views and Match Reports.



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