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. QTextCodec::codecForLocale does not work in N950 for codec GB2312 encoding text
Forum Updated to NodeBB v4.3 + New Features

QTextCodec::codecForLocale does not work in N950 for codec GB2312 encoding text

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 2.4k 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
    alex2202375
    wrote on last edited by
    #1

    I was using QTextCodec::codecForLocale to detect the suitable codec to decode some plain text, but I found when I set the local to China and had a text file which was encoded with GB2312 the QTextCodec::codecForLocale() did not return the right codec.

    The returned was "System", I checked the doc, it said "On Windows, the codec will be based on a system locale. On Unix systems, starting with Qt 4.2, the codec will be using the iconv library. Note that in both cases the codec's name will be "System".".

    But when I used the codec to decode some text, the same code worked well on windows, but on N950 the decoded string only contained English and number characters.
    Does anyone know why?

    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