| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 1 | |
Hi, I want to display french language text on qt-3.1 label. I have a french language text, but some characters of french are not displaying correclty on qt label. Can u tell me plz, is it nedded to download some fonts?????? this text is displaying correctly in windows notepad. But when i copied same text in linux in kate or gedit editor , some characters are not displaying correctly.. Can anybody help me plz???? Thanks and Regards, niranjan. -- [ signature omitted ]
Dnia piÄtek, 3 sierpnia 2007, Niranjan napisaÅ:
> I want to display french language text on qt-3.1 label. I have a french
> language text, but some characters of french are not displaying correclty
> on qt label. Can u tell me plz, is it nedded to download some fonts??????
Your problem is related to encoding. You should pass properly encoded strings
to QString(). For example: my sources are all encoded in UTF-8 so when I have
to put national characters I use QString::fromUtf8("ÅÃÄÅÄÅ") function...
You can also use QTextCodec - see Qt documentation for details.
Regards,
--
[ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.
On Friday 03 August 2007 16:10, RafaÅ Cygnarowski wrote:
hi,
Thank you very much. My problem is solved now using QString::fromUtf8
Thanks and Regards,
Niranjan.
> Dnia piÄtek, 3 sierpnia 2007, Niranjan napisaÅ:
> > I want to display french language text on qt-3.1 label. I have a french
> > language text, but some characters of french are not displaying correclty
> > on qt label. Can u tell me plz, is it nedded to download some fonts??????
>
> Your problem is related to encoding. You should pass properly encoded
> strings to QString(). For example: my sources are all encoded in UTF-8 so
> when I have to put national characters I use QString::fromUtf8("ÅÃÄÅÄÅ")
> function...
>
> You can also use QTextCodec - see Qt documentation for details.
>
> Regards,
--
[ signature omitted ]
Hi! > > Thank you very much. My problem is solved now using QString::fromUtf8 > > and for translation use trUtf8() http://doc.trolltech.com/4.3/qobject.html#trUtf8 Greetings Niklas -- [ signature omitted ]
Niranjan schrieb: > Hi, > > > I want to display french language text on qt-3.1 label. I have a french > language text, but some characters of french are not displaying correclty on > qt label. Can u tell me plz, is it nedded to download some fonts?????? Yes, the French indeed speak some weird language, so you need to install the FrenchFont(tm)(R) package ;) > this text is displaying correctly in windows notepad. But when i copied same > text in linux in kate or gedit editor , some characters are not displaying > correctly.. No seriously, your problem indeed seems to be related to some missing fonts on your Linux box. For example gedit is /not/ based on Qt (but on GTK IIRC), so if not even gedit is able to display e.g. éàçô (all characters with weird lines on top and snails on the bottom ;) then your installed fonts simply don't provide these characters - which seems very strange, because most (if not all) latin 1 based fonts support them. What about your email client on Linux (obviously KMail)? Is it able to display the above text correctly? This would indicate that it is not (purely) a missing font issue but maybe the font paths are (somehow) set differently for different applications... Good luck, Oliver -- [ signature omitted ]