[Interest] Why there is no QChar::toLocal8Bit()?

Thiago Macieira thiago.macieira at intel.com
Mon Apr 11 21:56:58 CEST 2016

On segunda-feira, 11 de abril de 2016 20:58:47 PDT Prav wrote:
> This probably mean that it is worth to WARN in docs that for
> QTextCodec::setCodecForLocale() do not use UTF-16 or something like this
> because toLocal8Bit (or may be many others) relies on fact that it is
> signle-byte or multi-byte locale.

toLocal8Bit has no problem with 16- or 32-bit codecs. It's the users of that 
API that do.

For example:

	printf("Content: %s\n", qPrintable(str));

If the locale codec is 32-bit, this is not going to work.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list