shlwapi: Use the standard WideCharToMultiByte instead of wine_utf8_wcstombs.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-24 12:40:59 +09:00
parent 0301c09d3e
commit 262a41ca4a

View file

@ -1200,16 +1200,15 @@ HRESULT WINAPI UrlEscapeW(
if ((cur >= 0xd800 && cur <= 0xdfff) && if ((cur >= 0xd800 && cur <= 0xdfff) &&
(src[1] >= 0xdc00 && src[1] <= 0xdfff)) (src[1] >= 0xdc00 && src[1] <= 0xdfff))
{ {
WCHAR sur[2]; len = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, src, 2,
utf, sizeof(utf), NULL, NULL );
sur[0] = cur; src++;
sur[1] = *++src;
len = wine_utf8_wcstombs(WC_ERR_INVALID_CHARS, sur, 2, utf, sizeof(utf));
} }
else else
len = wine_utf8_wcstombs(WC_ERR_INVALID_CHARS, &cur, 1, utf, sizeof(utf)); len = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, &cur, 1,
utf, sizeof(utf), NULL, NULL );
if(len < 0) { if (!len) {
utf[0] = 0xef; utf[0] = 0xef;
utf[1] = 0xbf; utf[1] = 0xbf;
utf[2] = 0xbd; utf[2] = 0xbd;