[Kde-java] Compressed Icons in Java Apps created with juic

Marco Ladermann marco.ladermann at gmx.de
Sun Aug 22 18:08:59 CEST 2004


Am Freitag, 20. August 2004 09:48 schrieb Richard Dale:
> So it just takes the java string and assumes it's 16 bit unicode.
>
> I've attached the .ui file I used for testing the ruby rbuic utility. It
> contains some Russian and Hebrew (right to left) text from the
> qt-copy/examples/fonts/simple-qfont-demo example.

For a short moment I thought the problem could be the c++ code, but it wasn't. 
It took me two days to figure out, how to detect in XSL/XPath that a XML text 
element contains a UTF-8 coded character.  XPath is not really made for bit 
testing ... Eventually I found a solution and checked it into cvs. I 
introduced two xslt-variables. c7 contains the 7 bit characters (except for 
some characters not allowed in xml) and c8 contains all 8 bit characters. A 
function runs through every string and tests the character of it, if it is 
contained in c8 or not contained in c7. If so,  it is assumed to be a utf-8 
character. If the stylesheet finds a character that seems to be a utf-8 
character the whole string is feed to the trUtf8() function instead of tr(). 
Your test .ui was very helpful. Thanks!

Marco
-- 
KISS - keep it small and simple


More information about the Kde-java mailing list