mercredi 22 avril 2009

Unicode CString and Qt QString


with Visual Studio, if you don't define UNICODE in the PREPROCESSOR
then it is straightforward:
CString a("hello");
QString qtstring (a);

but if you define UNICODE then this code does not compile anymore :-/
you should do then:
CString a("hello");
QString qtstring = QString::fromUtf16( a.GetBuffer(), a.GetLength() );

an advise? yes, be careful to encapsulate this sort of transformation in those bloody MFC programs!

Yes I know, I should have spoken about CSV files and SQLite :-)
I will do it soon !


Aucun commentaire:

Enregistrer un commentaire