Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to convert from HTML-encoded to QString UTF8?
Forum Updated to NodeBB v4.3 + New Features

How to convert from HTML-encoded to QString UTF8?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 790 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alaa Elrifaie
    wrote on last edited by
    #1

    Hi there,
    I wanna convert an HTML-encoded string into a QString to present it to the user.
    In Qt 4.8 I could do it this way:

    @qDebug() << "Result: " << resultName; // Returns this "사파아"

    QTextDocument qDoc;
    qDoc.setHtml(resultName);
    resultName = qDoc.toPlainText();

    qDebug() << "Result: " << resultName; // This should return "사파아" but it returns "???"@

    But when using this on Qt 5.3.1 it returns "???" instead of the proper "Korean" text!
    Where's the problem?!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Maybe your terminal does not support UTF-8? Try displaying the text in a QLabel.

      (Z(:^

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved