Commit 48c36db4 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

mlang: Accept "ascii" as an alias for "us-ascii".

parent 3069e0c0
...@@ -65,6 +65,7 @@ typedef struct ...@@ -65,6 +65,7 @@ typedef struct
const char *web_charset; const char *web_charset;
const char *header_charset; const char *header_charset;
const char *body_charset; const char *body_charset;
const WCHAR *alias;
} MIME_CP_INFO; } MIME_CP_INFO;
/* These data are based on the codepage info in libs/unicode/cpmap.pl */ /* These data are based on the codepage info in libs/unicode/cpmap.pl */
...@@ -363,6 +364,9 @@ static const MIME_CP_INFO vietnamese_cp[] = ...@@ -363,6 +364,9 @@ static const MIME_CP_INFO vietnamese_cp[] =
MIMECONTF_MIME_LATEST, MIMECONTF_MIME_LATEST,
"windows-1258", "windows-1258", "windows-1258" } "windows-1258", "windows-1258", "windows-1258" }
}; };
static const WCHAR asciiW[] = {'a','s','c','i','i',0};
static const MIME_CP_INFO western_cp[] = static const MIME_CP_INFO western_cp[] =
{ {
{ "IBM EBCDIC (US-Canada)", { "IBM EBCDIC (US-Canada)",
...@@ -415,7 +419,7 @@ static const MIME_CP_INFO western_cp[] = ...@@ -415,7 +419,7 @@ static const MIME_CP_INFO western_cp[] =
20127, MIMECONTF_MAILNEWS | MIMECONTF_IMPORT | MIMECONTF_EXPORT | 20127, MIMECONTF_MAILNEWS | MIMECONTF_IMPORT | MIMECONTF_EXPORT |
MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_VALID | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_VALID |
MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST,
"us-ascii", "us-ascii", "us-ascii" }, "us-ascii", "us-ascii", "us-ascii", asciiW },
{ "Western European (ISO)", { "Western European (ISO)",
28591, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | 28591, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT |
MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER |
...@@ -2600,6 +2604,13 @@ static HRESULT WINAPI fnIMultiLanguage3_GetCharsetInfo( ...@@ -2600,6 +2604,13 @@ static HRESULT WINAPI fnIMultiLanguage3_GetCharsetInfo(
strcpyW(pCharsetInfo->wszCharset, csetW); strcpyW(pCharsetInfo->wszCharset, csetW);
return S_OK; return S_OK;
} }
if (mlang_data[i].mime_cp_info[n].alias && !lstrcmpiW(Charset, mlang_data[i].mime_cp_info[n].alias))
{
pCharsetInfo->uiCodePage = mlang_data[i].family_codepage;
pCharsetInfo->uiInternetEncoding = mlang_data[i].mime_cp_info[n].cp;
strcpyW(pCharsetInfo->wszCharset, mlang_data[i].mime_cp_info[n].alias);
return S_OK;
}
} }
} }
......
...@@ -696,6 +696,17 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) ...@@ -696,6 +696,17 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags)
IEnumCodePage_Release(iEnumCP); IEnumCodePage_Release(iEnumCP);
} }
static void test_GetCharsetInfo_alias(IMultiLanguage *ml)
{
WCHAR asciiW[] = {'a','s','c','i','i',0};
MIMECSETINFO info;
HRESULT hr;
hr = IMultiLanguage_GetCharsetInfo(ml, asciiW, &info);
ok(hr == S_OK, "got %08x\n", hr);
ok(!lstrcmpW(info.wszCharset, asciiW), "got %s\n", wine_dbgstr_w(info.wszCharset));
}
static void scriptinfo_cmp(SCRIPTINFO *sinfo1, SCRIPTINFO *sinfo2) static void scriptinfo_cmp(SCRIPTINFO *sinfo1, SCRIPTINFO *sinfo2)
{ {
ok(sinfo1->ScriptId == sinfo2->ScriptId, "ScriptId mismatch: %d != %d\n", sinfo1->ScriptId, sinfo2->ScriptId); ok(sinfo1->ScriptId == sinfo2->ScriptId, "ScriptId mismatch: %d != %d\n", sinfo1->ScriptId, sinfo2->ScriptId);
...@@ -2000,6 +2011,7 @@ START_TEST(mlang) ...@@ -2000,6 +2011,7 @@ START_TEST(mlang)
test_GetNumberOfCodePageInfo((IMultiLanguage2 *)iML); test_GetNumberOfCodePageInfo((IMultiLanguage2 *)iML);
test_IMLangConvertCharset(iML); test_IMLangConvertCharset(iML);
test_GetCharsetInfo_alias(iML);
IMultiLanguage_Release(iML); IMultiLanguage_Release(iML);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment