PDA

View Full Version : Qt Linguist and coding sources



Hostel
30th October 2010, 15:47
I have source files with UTF-8 coding.

In .pro file I add


CODECFORTR = UTF-8
CODECFORSRC = UTF-8


In main.cpp I add


QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName ("UTF-8"));


And when I made lupdate then in Qt Linguist I have a good coding for words from .ui file and wrong from words which are from .cpp files.

How to resolve this?

Lykurg
31st October 2010, 05:28
And you are sure, the cpp files are really encoded in UTF8? Also try trUtf8() to see if the text gets extracted right.

Hostel
1st November 2010, 01:36
I resolve problem. I made mistake - in my system I have lupdate - which is from Qt3 and lupdate-qt4, so I used a wrong lupdate. Sorry for this.

But now I have wrong coding in window Sources and Forms when a source is display(I don't known a right name in eng because I have polish interface).