Re: Need program to convert UTF-8 -> Hex sequences

From: Miikka-Markus Alhonen (Miikka-Markus.Alhonen@tigatieto.com)
Date: Tue Mar 04 2003 - 07:49:26 EST

  • Next message: Michael Everson: "ISO/IEC 2375"

    Lainaus David Oftedal <david@start.no>:

    >> Sorry to make this a mass spam, but I need a program to convert UTF-8 to
    >> hex sequences. This is useful for embedding text in non-UTF web pages,
    >> but also for creating a Yudit keymap file, which I'm doing at the
    >> moment.
    >
    > Hm yes, so I see, but I should have been more specific, I actually need
    > an app that can do this automatically, either in ansi C, Perl, or a
    > Linux binary. I need to call it from a script, so it's got to happen
    > automatically. The find-replace to add the 0x I can do, so it's just a
    > matter of converting glyphs to codes.

    For use in Yudit, use Yudit itself :)

    You can do the conversion with the Yudit package by issuing the following
    command (in case the input is UTF-8; for others, use the -decode switch of
    uniconv):

     uniconv -encode java | perl -ne 's/\\u/0x/'

    And the opposite operation would similarly be:

     perl -ne 's/0x/\\u/' | uniconv -decode java

    Best regards,
    Miikka-Markus Alhonen



    This archive was generated by hypermail 2.1.5 : Tue Mar 04 2003 - 08:38:12 EST