Lainaus David Oftedal <[EMAIL PROTECTED]>: >> 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