[Development] Codec descriptions

Knoll Lars Lars.Knoll at digia.com
Mon Aug 5 10:41:31 CEST 2013


On 02.08.13 15:21, "David Faure" <faure at kde.org> wrote:

>Would it be possible to add a
>   QString QTextCodec::description() const
>which would return a (possibly translated) description (name) for the
>codec?

Ok for me.
>
>This would be useful in GUIs that show codecs to the user, e.g. to select
>a 
>different codec for a webpage or when loading/saving text in a text
>editor.
>
>But since AFAIK the codecs mostly come from ICU, the question is: does
>ICU 
>provide this data?

Not sure, you'd need to check. There's a ucnv_getDisplayName method, maybe
that returns what you need. If not, we could add the below strings and the
codecs they refer to as a table in qtextcodec.

Cheers,
Lars

>
>In KDE we have descriptions which include a sort of category (translated)
>followed by the untranslated raw charset name:
>
>Arabic ( ISO 8859-6 )
>Arabic ( cp 1256 )
>Baltic ( ISO 8859-13 )
>Baltic ( ISO 8859-4 )
>Baltic ( cp 1257 )
>Central European ( ISO 8859-2 )
>Central European ( ISO 8859-3 )
>Central European ( cp 1250 )
>Chinese Simplified ( GB18030 )
>Chinese Simplified ( GB2312 )
>Chinese Simplified ( GBK )
>Chinese Traditional ( Big5 )
>Chinese Traditional ( Big5-HKSCS )
>Cyrillic ( IBM866 )
>Cyrillic ( ISO 8859-5 )
>Cyrillic ( KOI8-R )
>Cyrillic ( KOI8-U )
>Cyrillic ( cp 1251 )
>Greek ( ISO 8859-7 )
>Greek ( cp 1253 )
>Hebrew ( ISO 8859-8 )
>Hebrew ( ISO 8859-8-I )
>Hebrew ( cp 1255 )
>Japanese ( EUC-JP )
>Japanese ( jis7 )
>Japanese ( sjis )
>Korean ( EUC-KR )
>Northern Saami ( winsami2 )
>Other ( IBM874 )
>Other ( TSCII )
>Other ( windows-1258 )
>South-Eastern Europe ( ISO 8859-16 )
>Thai ( ISO 8859-11 )
>Thai ( TIS620 )
>Turkish ( ISO 8859-9 )
>Turkish ( cp 1254 )
>Unicode ( ISO 10646-UCS-2 )
>Unicode ( UTF-16 )
>Unicode ( UTF-8 )
>Unicode ( ucs2 )
>Unicode ( utf7 )
>Western European ( IBM850 )
>Western European ( ISO 8859-1 )
>Western European ( ISO 8859-14 )
>Western European ( ISO 8859-15 )
>Western European ( cp 1252 )
>
>For sure this makes it easier for the user to select a charset from a
>dropdown 
>list compared to a list of raw names.
>
>-- 
>David Faure, faure at kde.org, http://www.davidfaure.fr
>Working on KDE, in particular KDE Frameworks 5
>
>_______________________________________________
>Development mailing list
>Development at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development




More information about the Development mailing list