Aric Stewart : mlang: Handle non Japanese case in ConvertUnknownJapaneseToUnicode.

Alexandre Julliard julliard at winehq.org
Thu Feb 5 09:20:58 CST 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Feb  4 13:58:20 2009 -0600

mlang: Handle non Japanese case in ConvertUnknownJapaneseToUnicode.

---

 dlls/mlang/mlang.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c
index f7d8097..11fa366 100644
--- a/dlls/mlang/mlang.c
+++ b/dlls/mlang/mlang.c
@@ -799,22 +799,30 @@ static UINT ConvertUnknownJapaneseToUnicode(LPCSTR input, DWORD count,
     int code = DetectJapaneseCode(input,count);
     TRACE("Japanese code %i\n",code);
 
-    if (code == 932)
+    switch (code)
     {
+    case 0:
+        if (output)
+            rc = MultiByteToWideChar(CP_ACP,0,input,count,output,out_count);
+        else
+            rc = MultiByteToWideChar(CP_ACP,0,input,count,0,0);
+        break;
+
+    case 932:
         if (output)
             rc = MultiByteToWideChar(932,0,input,count,output,out_count);
         else
             rc = MultiByteToWideChar(932,0,input,count,0,0);
-    }
-    else if (code == 51932)
-    {
+        break;
+
+    case 51932:
         if (output)
             rc = MultiByteToWideChar(20932,0,input,count,output,out_count);
         else
             rc = MultiByteToWideChar(20932,0,input,count,0,0);
-    }
-    else if (code == 50220)
-    {
+        break;
+
+    case 50220:
         sjis_string = HeapAlloc(GetProcessHeap(),0,count);
         rc = ConvertJIS2SJIS(input,count,sjis_string);
         if (rc)
@@ -826,6 +834,7 @@ static UINT ConvertUnknownJapaneseToUnicode(LPCSTR input, DWORD count,
                 rc = MultiByteToWideChar(932,0,sjis_string,rc,0,0);
         }
         HeapFree(GetProcessHeap(),0,sjis_string);
+        break;
     }
     return rc;
 }




More information about the wine-cvs mailing list