Alexandre Julliard : shlwapi: Use the standard WideCharToMultiByte instead of wine_utf8_wcstombs.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 24 11:01:42 CST 2016


Module: wine
Branch: master
Commit: 262a41ca4a9eb581c94088b94fa8aae118451b68
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=262a41ca4a9eb581c94088b94fa8aae118451b68

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb 24 12:40:59 2016 +0900

shlwapi: Use the standard WideCharToMultiByte instead of wine_utf8_wcstombs.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shlwapi/url.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c
index 0680a55..85fa3c1 100644
--- a/dlls/shlwapi/url.c
+++ b/dlls/shlwapi/url.c
@@ -1200,16 +1200,15 @@ HRESULT WINAPI UrlEscapeW(
                     if ((cur >= 0xd800 && cur <= 0xdfff) &&
                         (src[1] >= 0xdc00 && src[1] <= 0xdfff))
                     {
-                        WCHAR sur[2];
-
-                        sur[0] = cur;
-                        sur[1] = *++src;
-                        len = wine_utf8_wcstombs(WC_ERR_INVALID_CHARS, sur, 2, utf, sizeof(utf));
+                        len = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, src, 2,
+                                                   utf, sizeof(utf), NULL, NULL );
+                        src++;
                     }
                     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[1] = 0xbf;
                         utf[2] = 0xbd;




More information about the wine-cvs mailing list