[Interest] [Development] Charset probleme

Thiago Macieira thiago.macieira at intel.com
Mon Apr 29 16:38:19 CEST 2013


On segunda-feira, 29 de abril de 2013 13.49.54, Thomas PABST wrote:
> QTextCodec <http://qt-project.org/doc/qt-4.8/qtextcodec.html>::setCodecForTr
> (QTextCodec
> <http://qt-project.org/doc/qt-4.8/qtextcodec.html>::codecForName
> ("UTF-8"));
> QTextCodec <http://qt-project.org/doc/qt-4.8/qtextcodec.html>::
> setCodecForLocale(QTextCodec<http://qt-project.org/doc/qt-4.8/qtextcodec.htm
> l>
> ::codecForName("UTF-8"));
> 
> QTextCodec <http://qt-project.org/doc/qt-4.8/qtextcodec.html>::
> setCodecForCStrings(QTextCodec<http://qt-project.org/doc/qt-4.8/qtextcodec.h
> tml>
> ::codecForName("UTF-8"));

Hello Thomas

When posting to mailing lists, please send plain text emails. Your source code 
arrived really weirdly here -- you probably edited in HTML and your email 
client did the above.

Also, your post is not about development of Qt itself. I have therefore posted 
to the interest mailing list, which is about developing applications with Qt.

As Kai said, the above functions are gone from Qt 5. They are gone because 
they are not necessary:

	the codec for tr() is now UTF-8
	the codec for C strings is now UTF-8

Simply remove the calls from your application. You don't need them.

> const QString <http://qt-project.org/doc/qt-4.8/qstring.html> myVar = "text
> with accent é à è"
> 
> 
>  In this case the string is interpreted by gcc. Is there any QT DEFINE to
> force use of UTF-8 ?

If you don't pass any special arguments to GCC, it will *not* interpret the 
string. It will simply do a pass-through.

Anyway, Qt will use UTF-8, so you don't have to do anything.

In turn, if you're having a problem with the above, your problem is elsewhere. 
It's not what you think. Check if your source code is encoded in UTF-8.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130429/f2a46e6f/attachment.sig>


More information about the Interest mailing list