[Interest] QPlainTextEdit and a Unicode file

Scott Aron Bloom scott.bloom at onshorecs.com
Thu Apr 11 01:59:05 CEST 2013


I have a lovely customer, who has embedded Chinese text into an otherwise straight ascii file (imagine a C++ file with a Chinese name in comments.

Now, if he loads it up in a unicode aware editor on HIS machine, it views correctly (his machine is setup with Chinese as the locale and language).

However, in our tool, the view of that file in QPlainTextEdit is wrong, showing garbage characters.

He is not expecting a English based system to view it properly, but any guesses why its not working on the Chinese machiens?


The Loading process is as follows:
            QByteArray contents = fi.readAll();
            fi.close();
            setPlainText( contents );

Scott

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130410/8d13865f/attachment.html>


More information about the Interest mailing list