Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to set UTF-8 encoding globally?
Qt 6.11 is out! See what's new in the release blog

How to set UTF-8 encoding globally?

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 878 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.
  • G Offline
    G Offline
    Grynium
    wrote on last edited by
    #1

    Dear Qt Forum,
    I'm developing an embedded system based on Linux Yocto and Qt 5.3. The default character encoding of the system is ISO-8859-1.

    Some Qt applications needs to deal with files encoded in UTF-8. I was wondering: is there a way to set the default character encoding to use? E.g. a system call to execute at application startup?

    Searching in internet I've found that the QTextCodec::setCodecForCStrings() has been removed. I've tried to use the QTextCodec::setCodecForLocale but is seems that the set is limited to the function scope.

    Which is the right way to tell to a QCoreApplication that the default character encoding is UTF-8 (instead of system default)?

    Thanks in advance for your time

    Regards,
    Fabio

    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