PDA

View Full Version : How to manage french accents properly?



Caius Aérobus
28th March 2008, 09:09
Hello,
my problem is as simple as 123: I want to display french text, ie containing accents. I have tried almost all combinations with QString::from and QString::to without any success. For instance what is wrong here?


QString title=QString::fromLocal8Bit("Coordonnées parallèles");
printf("%s\n", title.toLocal8Bit().data());

Output:


Coordonnes Parallles

ChristianEhrlicher
28th March 2008, 09:27
You have to make sure your compiler uses the same codec like you did for editing. After this you can use the correct QString::fromFoo() - function. This issue was also asked on qt-interst ml many times.

A better solution would be to write all in english and then load a translation file.

Caius Aérobus
30th March 2008, 13:50
You have to make sure your compiler uses the same codec like you did for editing. After this you can use the correct QString::fromFoo() - function. This issue was also asked on qt-interst ml many times.

What is "qt-interest ml"? Could you please give me some pointer?


A better solution would be to write all in english and then load a translation file.

Yes I do know, a better solution for english speaking people would be everybody speak english and do no longer be annoying us with those bastard language issues ;)

jpn
30th March 2008, 16:24
What is "qt-interest ml"? Could you please give me some pointer?
Tried Google? :)


Yes I do know, a better solution for english speaking people would be everybody speak english and do no longer be annoying us with those bastard language issues ;)
It's not about people but tools. Tools are not humans, they cannot always interpret the complex train of thought of human brains.

katrina
30th March 2008, 17:54
What is "qt-interest ml"? Could you please give me some pointer?

The Qt-interest Mailing List: http://lists.trolltech.com/qt-interest/

firas
4th April 2008, 16:59
greetings trollers,
Another way to achieve correct multi-nation typing (including francias) would be to use QChar class + the corresponding uni-code in combination with QString, as following for Montréal, Québec:

QString message ("VidPro Research Group @ ECE Concordia, Montr"+QString(QChar(0x0E9))+"al - Qu"+QString(QChar(0x0E9))+"bec");

cheers
firas