supressed error messages when wxCSConv cannot find registry key and/or value when looking for charset information
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -369,20 +369,23 @@ static long CharsetToCodepage(const wxChar *name)
|
|||||||
|
|
||||||
wxString cn(name);
|
wxString cn(name);
|
||||||
do {
|
do {
|
||||||
wxString path( wxT("MIME\\Database\\Charset\\") );
|
wxString path(wxT("MIME\\Database\\Charset\\"));
|
||||||
path += cn;
|
path += cn;
|
||||||
wxRegKey key( wxRegKey::HKCR, path );
|
wxRegKey key(wxRegKey::HKCR, path);
|
||||||
|
|
||||||
/* two cases: either there's an AliasForCharset string,
|
if (!key.Exists()) continue;
|
||||||
* or there are Codepage and InternetEncoding dwords.
|
|
||||||
* The InternetEncoding gives us the actual encoding,
|
// two cases: either there's an AliasForCharset string,
|
||||||
* the Codepage just says which Windows character set to
|
// or there are Codepage and InternetEncoding dwords.
|
||||||
* use when displaying the data.
|
// The InternetEncoding gives us the actual encoding,
|
||||||
*/
|
// the Codepage just says which Windows character set to
|
||||||
if (key.QueryValue( wxT("InternetEncoding"), &CP )) break;
|
// use when displaying the data.
|
||||||
|
if (key.HasValue(wxT("InternetEncoding")) &&
|
||||||
|
key.QueryValue(wxT("InternetEncoding"), &CP)) break;
|
||||||
|
|
||||||
// no encoding, see if it's an alias
|
// no encoding, see if it's an alias
|
||||||
if (!key.QueryValue( wxT("AliasForCharset"), cn )) break;
|
if (!key.HasValue(wxT("AliasForCharset")) ||
|
||||||
|
!key.QueryValue(wxT("AliasForCharset"), cn)) break;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
return CP;
|
return CP;
|
||||||
|
Reference in New Issue
Block a user