[Qt-interest] Accented characters and QDom in Windows

Ellen Kestrel dragonflykes at gmail.com
Fri Aug 21 05:41:58 CEST 2009


Thanks, Thiago.

The issue with the special characters not showing isn't (necessarily)
related to inputs from files or hard-coded strings; if the user types (or
copies and pastes) the character into a line edit widget or similar, it
shows up as a line or a box in the line edit.  Also, the fromXXX functions
all take character arrays, so while they do work with hard-coded text, the
user input is already in QString form by the time I get it.

EK

On Thu, Aug 20, 2009 at 4:27 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 20.08.09 15:26:07, Ellen Kestrel wrote:
> > Are there other instances when I should be worrying about specifying text
> > encodings in cross-platform apps?  I have noticed that in display widgets
> > the linux apps will display weird characters that the Windows apps won't,
> > but I don't know if that's related at all, or if it's just a matter of
> not
> > having Windows configured properly.
>
> That sounds as if this is the text set via things like
> QPushButton::setText. If those texts contains characters that are not
> part of plain us-ascii you should use the QString::fromXXX functions to
> convert the literal text into a QString explicitly and make sure that
> the XXX matches the encoding in which you store the file on disk. Your
> best option here is to use QString::fromUtf8() and make sure your source
> code file is properly encoded as utf-8.
>
> And of course any time you read text files from disk you need to make
> sure you know the encoding of them if you don't want to treat them as
> pure byte-arrays.
>
> Andreas
>
> --
> You will be given a post of trust and responsibility.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090820/1658e872/attachment.html 


More information about the Qt-interest-old mailing list