Re: [Php-qt-users] QLineEdit and utf-8 strings
Status: Beta
Brought to you by:
tm243
From: Thomas M. <tm...@ip...> - 2006-01-16 11:37:41
|
Ferenc Veres wrote on Montag, 16. Januar 2006 01:41: > Works: > $this->txtGuessPercents[$i]->setText($tr["percent"]."%"); > > Does not work: > $this->txtGuessPercents[$i]->$text = $tr["percent"]."%"; > > Error message: "Cannot access empty property". According to the Qt docs > there is a .text property, but I don't understand the ZEND code in > qlineedit.cpp to see what it can do. :-) This is not possible. PHP-properties are provided as you can see in a few classes. You can readout it, but not write to it directly. It may be possible to store your values into the php object, but property is a passive element and cannot forward its value to the real C++ object. You have to use the setText() way to store the value instead. > 2. QString character code conversions > > I think these routines are not ready yet, it would be great to have them > as time allows. As you could saw on my tests, all localized strings were > displayed broken. > > ::toUtf8 > ::fromUtf8 > > and similar functions. > > I don't have any utf-16 strings, so all I can do with QString is dumping > core files. :-) > > $txt = new QString("Hello"); > $this->txtGuessTranslations[$i]->setText($txt); > > Something like that? (Dumps core at the moment, in the second line.) > That would probably require QString's static ::fromUtf8 or ::fromAscii > methods, becase "Hello" written in source code is not Unicode. > > Anyway, I am not sure my code handles the UTF-8 strings right, I did > nothing more than adding the encoding to the originating XML's header > and creating MySQL tables with UTF-8 setting. I did nothing in PHP > direcly. (I don't have such strings in the source code of course.) > > When I fill those UTF-8 strings to the QLineEdit, they display as "UTF-8 > binary". I write it to the TODO list. It seems to be a little bit tricky, I hope we do not have to touch the zend engine ;-) -- Thomas _______________________________________________ Php-qt-users mailing list Php...@li... http://lists.berlios.de/mailman/listinfo/php-qt-users |