Results 1 to 4 of 4

Thread: Encoding of characters in frensh ?

  1. #1
    Join Date
    Dec 2013
    Location
    Jerada, Morroco
    Posts
    106
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Encoding of characters in frensh ?

    I want to encode character like "é" and "à " without using the code of the character every time.
    I tried with tr() for example tr("Propriété") but is not worked.

    Im using Visual studio 2012 and Qt5.

  2. #2
    Join Date
    Feb 2014
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Encoding of characters in frensh ?

    Try to use : _fromUtf8 = QtCore.QString.fromUtf8
    and then my_str = _fromUtf8(my_str)

  3. #3
    Join Date
    Dec 2013
    Location
    Jerada, Morroco
    Posts
    106
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Encoding of characters in frensh ?

    Thanx for your reply but i want a generic method to do this instead of changing every QString in my code

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Encoding of characters in frensh ?

    Qt5 assumes that your files are encoded in UTF-8.
    http://www.macieira.org/blog/2012/05...ring-wants-it/

    Just change your file encoding to UTF-8

    Cheers,
    _

Similar Threads

  1. Qt Ubuntu encoding of Characters
    By airglide in forum Qt Programming
    Replies: 3
    Last Post: 27th January 2013, 14:38
  2. encoding problem
    By lexqqq in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2010, 23:41
  3. QTextCodec bad encoding?
    By ComaWhite in forum Newbie
    Replies: 0
    Last Post: 18th September 2009, 06:15
  4. Replies: 1
    Last Post: 5th February 2009, 23:50
  5. Encoding a QString to No.?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 30th August 2007, 19:08

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.