[Qt-interest] character encoding type supported in QT...

Reece Dunn msclrhd at googlemail.com
Mon Mar 7 08:06:00 CET 2011


On 7 March 2011 04:45, suma s <suma_s27 at yahoo.co.in> wrote:
>
> hai all...
> may i know... what is the character encoding type supported in QT??....
> when i worked through this.. i found that QT is using UTF-8 style of character encoding... but the directfb module in scr/plugins/gfxdrivers/ has a ascii encoding type...
> ie.,  file -bi qdirectfbkeyboard.cpp .. it says..text/plain; charset=us-ascii
> so i just wanted to know about this???...

The ASCII text encoding covers the values in the range 0-127 (or 0x00
to 0x7F) of each byte (char) in a string.

All other single-byte encodings keep this range for ASCII text. They
use the range 128-255 (0x80-0xFF) to indicate that this is part of a
multi-byte character (where the subsequent bytes may contain bytes in
the 0-127 range -- such as UTF-8 or ShiftJIS), or is a single-byte
encoding with 128-255 being special characters (e.g. the Windows 1252
encoding).

This is done such that these encodings can also read ASCII text
(unlike UTF-16 and UTF-32 that always use 2 or 4 bytes for each
character).

HTH,
- Reece



More information about the Qt-interest-old mailing list