Results 1 to 6 of 6

Thread: How to manage french accents properly?

  1. #1
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to manage french accents properly?

    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?
    Qt Code:
    1. QString title=QString::fromLocal8Bit("Coordonnées parallèles");
    2. printf("%s\n", title.toLocal8Bit().data());
    To copy to clipboard, switch view to plain text mode 
    Output:
    Qt Code:
    1. Coordonnes Parallles
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to manage french accents properly?

    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.

  3. #3
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to manage french accents properly?

    Quote Originally Posted by ChristianEhrlicher View Post
    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?

    Quote Originally Posted by ChristianEhrlicher View Post
    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

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to manage french accents properly?

    Quote Originally Posted by Caius Aérobus View Post
    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.
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Location
    Berlin, Germany
    Posts
    64
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to manage french accents properly?

    Quote Originally Posted by Caius Aérobus View Post
    What is "qt-interest ml"? Could you please give me some pointer?
    The Qt-interest Mailing List: http://lists.trolltech.com/qt-interest/
    Katrina Niolet

  6. #6
    Join Date
    Jan 2006
    Posts
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Lightbulb Re: How to manage french accents properly?

    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:
    Qt Code:
    1. QString message ("VidPro Research Group @ ECE Concordia, Montr"+QString(QChar(0x0E9))+"al - Qu"+QString(QChar(0x0E9))+"bec");
    To copy to clipboard, switch view to plain text mode 

    cheers
    firas
    Last edited by jpn; 5th April 2008 at 18:38. Reason: changed [qtclass] to [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.