[Interest] It is possible to get the actual name of a local character set?

Thiago Macieira thiago.macieira at intel.com
Wed Dec 26 16:02:58 CET 2012


On quarta-feira, 26 de dezembro de 2012 16.42.44, Nikos Chantziaras wrote:
> > Why do you need the codec name anyway?
> 
> So that I can tell another library what encoding to use for filenames 
> when it wants to create files.

Can't you tell it to use the default?

By the way, on Windows you should always choose UTF-16, both on the Qt and the 
3rd-party library's side. The Windows "A" (ANSI) API as well as the POSIX-
style CRT API are unable to deal with all the possible file names that the 
Windows "W" (Wide) API can deal with.

QFile already uses the "W" API, so you don't have to do anything.

But that means you must not use QFile::encodeName on Windows. Simply pass the 
QString's original UTF-16 data and tell the other library to use the "W" API 
too.

Anything else, on Windows, is dead-on-arrival.
-- 
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/20121226/c0d0575b/attachment.sig>


More information about the Interest mailing list