Results 1 to 2 of 2

Thread: Convert characters to entities

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Convert characters to entities

    Hi friends,

    I'm need convert QString characters, like "ç", "á", "â" and others to respective entities.
    Ex.: Caçar to Caçar.

    I'ts possible? I find Qt::escape( ), but don't work with these characters.
    Thanks,

    Marcelo E. Geyer.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Convert characters to entities

    (Side note: a html file may be encoded in utf-8, iso 8859-1 or other encodings.
    therefore it is not necessary to replace these unicode characters in a unicode html encoding. However, "<", ">", "&" do have to be escaped, which is what Qt::escape does.)

    What you want to achieve is html text that displays unicode but is encoded in something like iso 8859-1, right?

    I am not aware of a function in Qt that does this (though there might be one).
    So I can only suggest that you define that mapping in your code and iterate over your html replacing such characters by their entity.

    HTH

Similar Threads

  1. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 14:18

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.