summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/options.cpp40
1 files changed, 13 insertions, 27 deletions
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 344df3c89d..fcca7bbc3f 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -273,32 +273,22 @@ struct { UINT cpId; TCHAR *cpName; } static cpTable[] =
static CCtrlCombo* sttCombo;
-typedef BOOL ( WINAPI *pfnGetCPInfoEx )( UINT, DWORD, LPCPINFOEX );
-static pfnGetCPInfoEx fnGetCPInfoEx = NULL;
-
-static BOOL CALLBACK sttLangAddCallback( CHAR* str )
+static BOOL CALLBACK sttLangAddCallback(CHAR *str)
{
UINT cp = atoi(str);
- if ( fnGetCPInfoEx == NULL ) {
- int i;
- for ( i=0; i < SIZEOF(cpTable) && cpTable[i].cpId != cp; i++ );
- if ( i < SIZEOF(cpTable))
- sttCombo->AddString( TranslateTS( cpTable[i].cpName ), cp );
- }
- else {
- CPINFOEX cpinfo;
- if ( fnGetCPInfoEx( cp, 0, &cpinfo )) {
- TCHAR* b = _tcschr( cpinfo.CodePageName, '(' );
- if ( b ) {
- TCHAR* e = _tcsrchr( cpinfo.CodePageName, ')' );
- if ( e ) {
- *e = 0;
- sttCombo->AddString( b+1, cp );
- }
- else sttCombo->AddString( cpinfo.CodePageName, cp );
+ CPINFOEX cpinfo;
+ if (GetCPInfoEx(cp, 0, &cpinfo)) {
+ TCHAR* b = _tcschr( cpinfo.CodePageName, '(' );
+ if ( b ) {
+ TCHAR* e = _tcsrchr( cpinfo.CodePageName, ')' );
+ if ( e ) {
+ *e = 0;
+ sttCombo->AddString( b+1, cp );
}
else sttCombo->AddString( cpinfo.CodePageName, cp );
- } }
+ }
+ else sttCombo->AddString( cpinfo.CodePageName, cp );
+ }
return TRUE;
}
@@ -1058,11 +1048,7 @@ void COtherPrefsDlg::OnInitDialog()
m_add.Enable( m_proto->m_perform );
m_delete.Enable( m_proto->m_perform );
- fnGetCPInfoEx = ( pfnGetCPInfoEx )GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetCPInfoExW" );
-
- m_codepage.AddString( TranslateT("Default ANSI codepage"), CP_ACP );
- if ( fnGetCPInfoEx == NULL )
- m_codepage.AddString( TranslateT("UTF-8"), CP_UTF8 );
+ m_codepage.AddString(TranslateT("Default ANSI codepage"), CP_ACP);
sttCombo = &m_codepage;
EnumSystemCodePagesA(sttLangAddCallback, CP_INSTALLED);