[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QCString - QString conversion
From:       Thiago Macieira <thiago () kde ! org>
Date:       2005-04-01 17:22:51
Message-ID: 200504011422.53638.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


David Jarvie wrote:
>What is the inverse of QString::operator=(const QCString&)? I need to
>convert a QString (obtained from a library function) back to the
> original QCString which the library converted it from, and I don't want
> encodings to mess things up. The QString documentation doesn't make it
> clear to me.

Avoid using the direct 8bit-to-QString assignments at all costs. That 
includes the operator= you mentioned.

Instead, please use QString::fromLatin1, QString::fromLocal8Bit, 
QString::fromUtf8 (for QCString or char* to QString conversion), or 
QString::latin1, QString::local8Bit, QString::utf8 (for QString to char* 
conversion).

Summary answer: that depends on the encoding. One of the three functions I 
mentioned or using a QTextCodec.

-- 
  Thiago Macieira  -  thiago (AT) macieira (DOT) info
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

1. On frumscafte, hwonne time_t wæs náht, se scieppend þone circolwyrde 
wundorcræftlíge cennede and seo eorðe wæs idel and hit wæs gód.

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic