in lib/normalize.cxx [15:106]
STRA name(__ach##name, sizeof(__ach##name) / sizeof(CHAR))
#endif
HRESULT
InitializeNormalizeUrl(
VOID
)
{
HKEY hKey;
DWORD dwType;
DWORD dwData;
DWORD cbData;
WORD wPrimaryLangID;
//
// Read the registry settings on how to handle URLs
//
g_fEnableNonUTF8 = TRUE;
g_fEnableDBCS = FALSE;
g_fFavorDBCS = FALSE;
if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
L"System\\CurrentControlSet\\Services\\http\\Parameters",
0,
KEY_READ,
&hKey ) == ERROR_SUCCESS )
{
cbData = sizeof( dwData );
if ( RegQueryValueEx( hKey,
L"EnableNonUTF8",
NULL,
&dwType,
(LPBYTE) &dwData,
&cbData ) == ERROR_SUCCESS &&
dwType == REG_DWORD )
{
g_fEnableNonUTF8 = !!dwData;
}
if ( g_fEnableNonUTF8 )
{
cbData = sizeof( dwData );
if ( RegQueryValueEx( hKey,
L"EnableDBCS",
NULL,
&dwType,
(LPBYTE) &dwData,
&cbData ) == ERROR_SUCCESS &&
dwType == REG_DWORD )
{
g_fEnableDBCS = !!dwData;
}
}
else
{
g_fEnableDBCS = FALSE;
}
if ( g_fEnableDBCS )
{
cbData = sizeof( dwData );
if ( RegQueryValueEx( hKey,
L"FavorDBCS",
NULL,
&dwType,
(LPBYTE) &dwData,
&cbData ) == ERROR_SUCCESS &&
dwType == REG_DWORD )
{
g_fFavorDBCS = !!dwData;
}
}
else
{
g_fFavorDBCS = FALSE;
}
RegCloseKey( hKey );
}
wPrimaryLangID = PRIMARYLANGID( GetSystemDefaultLangID() );
g_fIsSystemDBCS = ( wPrimaryLangID == LANG_JAPANESE ||
wPrimaryLangID == LANG_CHINESE ||
wPrimaryLangID == LANG_KOREAN );
return NO_ERROR;
}