Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » enumCharSet() funtion
enumCharSet() funtion [message #5583] |
Wed, 04 October 2006 19:24 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
Hi!
This function may be useful to someone.
int enumCharSet()
{
static int chs[] = {
CHARSET_ISO8859_1, CHARSET_ISO8859_2, CHARSET_ISO8859_3, CHARSET_ISO8859_4,CHARSET_ISO8859_5,
CHARSET_ISO8859_6, CHARSET_ISO8859_7, CHARSET_ISO8859_8, CHARSET_ISO8859_9, CHARSET_ISO8859_10,
CHARSET_ISO8859_13, CHARSET_ISO8859_14, CHARSET_ISO8859_15, CHARSET_ISO8859_16,
CHARSET_WIN1250, CHARSET_WIN1251, CHARSET_WIN1252, CHARSET_WIN1253, CHARSET_WIN1254,
CHARSET_WIN1255,CHARSET_WIN1256, CHARSET_WIN1257, CHARSET_WIN1258, CHARSET_KOI8_R,
CHARSET_CP852, CHARSET_MJK, CHARSET_UTF8 } ;
static int i = -1, size = sizeof(chs) / sizeof(chs[0]) ;
if (i >= size )
{
i = -1 ;
return 0 ;
}
else if (i == -1)
i = 1 ;
else
i++ ;
return chs[i] ;
}
We can add all charset to a DropList like this
int ch ;
while( (ch = enumCharSet()) != 0)
dropCharSet.Add( ch, CharsetName( ch ) ) ;
dropCharSet.SetData(GetDefaultCharset()) ;
Nico
|
|
|
Goto Forum:
Current Time: Fri Apr 19 05:39:42 CEST 2024
Total time taken to generate the page: 0.02699 seconds
|