Re: UTF-8 to local with #uXXXX escapes



Ralf Stephan <ralf ark in-berlin de> writes:

> Now, I would like output like #u01a8 for Unicode characters.
> How could one accomplish this? Wouldn't there be need for such
> a conversion function?

If you can hook into the framework, you can always write your own
converter with something like (not checked):

   string convert_single_char(int chr)
   {
     if (char < 127)
       return string(chr);
     else {
       char buf[20];

       snprintf(buf, 20, "#%4x", chr);
       return string(buf);
     }
   }

I don't know if you can hook into the framework, but then you could
always just loop through the string, converting single characters on
the fly.
   
-- 
Ole Laursen
http://www.iola.dk/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]