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

Prav pr12og2 at programist.ru
Mon Apr 11 08:46:24 CEST 2016


Hi, Thiago.

> Yes. It's possible, though extremely unlikely, that the locale's encoding is
> not 8-bit, but 16- or 32-bit. Though I think that a lot of software would
> break
Sure I am aware of it.

> , so you're not going to see that.
Why you think I want to "see that". Its Qt-devs naming mistake.
So it is only decision of Qt-devs (probably yours) when and whether to fix it (may be like it was done with toAscii in Qt 5.0 ... it would be done
in Qt 6.0 ... who knows).

But naming mistakes are worth to be fixed in docs, IMO


> Anyway, the point is that it's very frequently a multibyte 8-bit encoding.
Ok ok :) :) :)


And last question ... is there a way to find out what type of encoding was done by toLocal8Bit? sigle-byte or multi-byte or 16- or 32-bit

I was thinking about: QTextCodec::codecForLocale()-> ...
But I did not found anything helpful in QTextCodec for that purpose.




More information about the Interest mailing list