]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
More fixes to the microsoft code-page nightmare... (CVS 3544)
authordrh <drh@noemail.net>
Thu, 21 Dec 2006 03:20:40 +0000 (03:20 +0000)
committerdrh <drh@noemail.net>
Thu, 21 Dec 2006 03:20:40 +0000 (03:20 +0000)
FossilOrigin-Name: 0b47d88060069781e7e184806d6ecaeff9b9e5d1

manifest
manifest.uuid
src/os_win.c

index 1d4fb184f792a8fc45f71d7ebe321ea48b7c8016..e5165bb40e8b153a82b20d9453984700fcb864fb 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Use\sGetProcAddressA()\son\swince.\s\sTicket\s#2123\s(CVS\s3543)
-D 2006-12-21T02:21:57
+C More\sfixes\sto\sthe\smicrosoft\scode-page\snightmare...\s(CVS\s3544)
+D 2006-12-21T03:20:41
 F Makefile.in 8e14898d41a53033ecb687d93c9cd5d109fb9ae3
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -83,7 +83,7 @@ F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
 F src/os_unix.c d4bc8cbe1c0dc330bd55bf7821db5b7dbfbf183e
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
-F src/os_win.c d7cf0fc2acd9d2a519a9442f78b4bdbf30e730d6
+F src/os_win.c ca46001d4ec446885f72d3b7fd6a657136156228
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
 F src/pager.c 814268d5bbd69f30069867142f1d460b8b7ab778
 F src/pager.h 2e6d42f4ae004ae748a037b8468112b851c447a7
@@ -423,7 +423,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 6d2ff0962dff0477fe2af0323032dc16337f42ab
-R 1a4c9add7b3dd8462c8e8800ce5e3721
+P e3dddd1cef5877c009852fd7f484973843e26e00
+R 73c89ed5916e57284a7ee348ebe00fd3
 U drh
-Z 485f836110e73c29878298d90fc161b1
+Z da8e9bd7450544645912de3f756444c4
index 4bd3dbbd1f222206006336900b82c06bf92f3ea4..abdf5d7c3368784e9c34c3ac0f5e1050be35186a 100644 (file)
@@ -1 +1 @@
-e3dddd1cef5877c009852fd7f484973843e26e00
\ No newline at end of file
+0b47d88060069781e7e184806d6ecaeff9b9e5d1
\ No newline at end of file
index 0961060781a53879399ec94ada08291d5ed4b777..19781058b1dd43e799d373045944f99d7c5b2e33 100644 (file)
@@ -124,8 +124,9 @@ int sqlite3_os_type = 0;
 #endif /* OS_WINCE */
 
 /*
-** Convert a UTF-8 string to UTF-32.  Space to hold the returned string
-** is obtained from sqliteMalloc.
+** Convert a UTF-8 string to microsoft unicode (UTF-16?). 
+**
+** Space to hold the returned string is obtained from sqliteMalloc.
 */
 static WCHAR *utf8ToUnicode(const char *zFilename){
   int nChar;
@@ -145,7 +146,7 @@ static WCHAR *utf8ToUnicode(const char *zFilename){
 }
 
 /*
-** Convert UTF-32 to UTF-8.  Space to hold the returned string is
+** Convert microsoft unicode to UTF-8.  Space to hold the returned string is
 ** obtained from sqliteMalloc().
 */
 static char *unicodeToUtf8(const WCHAR *zWideFilename){
@@ -167,20 +168,23 @@ static char *unicodeToUtf8(const WCHAR *zWideFilename){
 }
 
 /*
-** Convert a multibyte character string to UTF-32, based on the current
-** Ansi codepage (CP_ACP). Space to hold the returned string is obtained
+** Convert an ansi string to microsoft unicode, based on the
+** current codepage settings for file apis.
+** 
+** Space to hold the returned string is obtained
 ** from sqliteMalloc.
 */
 static WCHAR *mbcsToUnicode(const char *zFilename){
   int nByte;
   WCHAR *zMbcsFilename;
+  int codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
 
-  nByte = MultiByteToWideChar(CP_ACP, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR);
+  nByte = MultiByteToWideChar(codepage, 0, zFilename, -1, NULL,0)*sizeof(WCHAR);
   zMbcsFilename = sqliteMalloc( nByte*sizeof(zMbcsFilename[0]) );
   if( zMbcsFilename==0 ){
     return 0;
   }
-  nByte = MultiByteToWideChar(CP_ACP, 0, zFilename, -1, zMbcsFilename, nByte);
+  nByte = MultiByteToWideChar(codepage, 0, zFilename, -1, zMbcsFilename, nByte);
   if( nByte==0 ){
     sqliteFree(zMbcsFilename);
     zMbcsFilename = 0;
@@ -189,20 +193,23 @@ static WCHAR *mbcsToUnicode(const char *zFilename){
 }
 
 /*
-** Convert UTF-32 to multibyte character string, based on the user's Ansi
-** codepage (CP_ACP). Space to hold the returned string is obtained from
+** Convert microsoft unicode to multibyte character string, based on the
+** user's Ansi codepage.
+**
+** Space to hold the returned string is obtained from
 ** sqliteMalloc().
 */
 static char *unicodeToMbcs(const WCHAR *zWideFilename){
   int nByte;
   char *zFilename;
+  int codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
 
-  nByte = WideCharToMultiByte(CP_ACP, 0, zWideFilename, -1, 0, 0, 0, 0);
+  nByte = WideCharToMultiByte(codepage, 0, zWideFilename, -1, 0, 0, 0, 0);
   zFilename = sqliteMalloc( nByte );
   if( zFilename==0 ){
     return 0;
   }
-  nByte = WideCharToMultiByte(CP_ACP, 0, zWideFilename, -1, zFilename, nByte,
+  nByte = WideCharToMultiByte(codepage, 0, zWideFilename, -1, zFilename, nByte,
                               0, 0);
   if( nByte == 0 ){
     sqliteFree(zFilename);
@@ -1513,12 +1520,12 @@ void *sqlite3WinDlopen(const char *zFilename){
     return 0;
   }
   if( isNT() ){
-    h = LoadLibraryW(zConverted);
+    h = LoadLibraryW((WCHAR*)zConverted);
   }else{
 #if OS_WINCE
     return 0;
 #else
-    h = LoadLibraryA(zConverted);
+    h = LoadLibraryA((char*)zConverted);
 #endif
   }
   sqliteFree(zConverted);