Re: [Php-qt-users] QLineEdit and utf-8 strings - unicode support
Status: Beta
Brought to you by:
tm243
From: Ferenc V. <li...@ne...> - 2006-01-20 22:46:21
|
Hi, Thanks for the answers! Thomas Moenicke wrote: > Ferenc Veres wrote on Dienstag, 17. Januar 2006 02:12: >=20 >>Then what is the input encoding?=20 .. > Trolls wrote: > "Constructs a string initialized with the ASCII string str." > And next > "str is converted to Unicode using fromAscii()." I did some tests, with Tutorial 1 in both PHP_QT and C++, and I think it can accept iso-8859-1 encoded characters too. Not only the first 127 ASCII characters display right on the Tutorial 1 button, but if you use 127 to 255 byte values, they display like those byte codes look in iso-8859-1 character set! (latin1) Fine. Not useful for Hungarian, but an acceptable extra feature. ;-) > Lets finish QString and test all functions there. All I have seen in ph= p=20 > internals stores strings binary. Maybe, we have luck. For example entering "=C5=B1" in iso-8859-2 edited source code will displ= ay "=C3=BB" on a button, as that is the same BYTE VALUE in iso-8859-1. It's okay. I just needed to know, it expects Latin1 characters. Now I can also test toUtf8(). :-) > We will see. There are > toAscii() > toLatin1 > toUtf8 My test results confirm that everything is alright! ;-) From tests/unicode.php, changing the input string to > 127 characters, ->toUtf8() displays characters right on my Konsole, so I think, the latin1 to utf-8 conversion is done. (Of course if I edit in Latin1 or Latin2, I can see different characters on the same byte code, but both the characters display as their latin1 value on the button label or console. KWrite is a very good editor to test this.) Printing the string with echo, prints binary dirt, that's also correct, because the byte sequence of the latin-1 characters have no meaning if for my utf-8 console. Displaying on and inside widgets, will be up to Qt, when we can pass QString to them. I'll have my input data in utf-8, so I think fromUtf8 could be used, but currently I cannot call that method on QString. Will it be implemented as static method like the C++? (If yes, I think I will need an example on how to call. :-) ) Many thanks and keep up the good work! ;-) Ferenc ps: may I report problems with any widgets appearing in the source? If yes, then I think QLabel is completely broken. :-) |