Some codepages use 2 bytes per wide character instead of only 1.
From: Danyil Blyschak dblyschak@codeweavers.com
Some codepages use 2 bytes per wide character instead of only 1. --- dlls/mlang/mlang.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index fd78f47fdb2..e340a5f57c7 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -3299,10 +3299,10 @@ static HRESULT WINAPI fnIMLangFontLink2_GetCharCodePages( IMLangFontLink2* iface for (i = 0; i < ARRAY_SIZE(mlang_data) - 1 /* skip unicode codepages */; i++) { BOOL used_dc; - CHAR buf; + CHAR buf[2];
WideCharToMultiByte(mlang_data[i].family_codepage, WC_NO_BEST_FIT_CHARS, - &ch_src, 1, &buf, 1, NULL, &used_dc); + &ch_src, 1, buf, 2, NULL, &used_dc);
/* If default char is not used, current codepage include the given symbol */ if (!used_dc)
Zhiyi Zhang (@zhiyi) commented about dlls/mlang/mlang.c:
for (i = 0; i < ARRAY_SIZE(mlang_data) - 1 /* skip unicode codepages */; i++) { BOOL used_dc;
CHAR buf;
CHAR buf[2];
For UTF-8, it can be up to 4 bytes per wide char.