Results 1 to 1 of 1

Thread: QString unicode replace

  1. #1
    Join Date
    Aug 2009
    Posts
    92
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QString unicode replace

    I have to replace ’ (unicode int num 8217) to ' (normal single quote) with QString.
    How is it possible ?


    Added after 12 minutes:


    Ok, found.

    Qt Code:
    1. s.replace(QString::fromWCharArray(L"\u2019"), "'");
    To copy to clipboard, switch view to plain text mode 

    I thought it was not working as to terminal it prints strange chars, but with the debugger I can see that it has been properly replaced.
    Last edited by trallallero; 26th June 2012 at 14:57.

Similar Threads

  1. qstring replace backslash by forward-slashes
    By ruben.rodrigues in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2012, 12:07
  2. [solved]QString.replace()
    By Qiieha in forum Qt Programming
    Replies: 1
    Last Post: 16th September 2011, 09:15
  3. QString and Unicode
    By juanjo_de_la_pradera in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2010, 13:38
  4. QString - find and replace text
    By graciano in forum Newbie
    Replies: 3
    Last Post: 24th January 2009, 20:35
  5. QString::replace() with QRegExp capture modification
    By Lykurg in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2008, 09:50

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.