Robert Simpson wrote:
CP_UTF8 doesn't work on most CE platforms and hence your proposed patch
doesn't work.

Then neither did drh's. Which then only leaves the option of implementing it in os_win.c which I have been wanting to do all along.

> Robert wrote:
>> Brodie wrote:
>>> Robert wrote:
Here's what I propose ...
 > #ifdef _UNICODE
 > #define OSSTR wchar_t
 > #else
 > #define OSSTR char
 >
 > OSSTR *utf8toOS(char *utf8)
 > void utf8toOSFree(OSSTR *apiString)

Although it is nice since it is simple, it is worse than the current
solution. Firstly, with the current method, only Windows 95 is broken.
Additionally, the current solution has the nice property of using the
unicode functions whenever available (i.e. when running on WinNT)
regardless of build type.

Your proposal takes a step backwards to providing Unicode support only
when compiled as a Unicode application. It is better to continue the
current method of calling W functions where possible and falling back
to
A only when necessary, just process the string sent into the A function
so that it is properly ACP/OEM as necessary.

I'm not sure what you're getting all worked up over.  How is "providing
unicode support only when compiled as a unicode application" a Bad Thing?

Because as explained, the current sqlite DLL provides Unicode support to Windows NT clients regardless of whether built as ansi or unicode. Therefore a single DLL supports all clients on either Win95 or WinNT with best available functionality. The Windows way of either/or is not as flexible. You compile with as a unicode DLL and it isn't usable on Win95 (unless you also use MSLU). You compile as multibyte and you lose full unicode functionality on winNT. It's lose/lose compared to the current method.

New patch to fix this. Attached to the original bug and included.
http://www.sqlite.org/cvstrac/tktview?tn=2023


--- ..\sqlite-source-3_3_8.orig\os.h    2006-10-08 13:51:00.000000000 -0300
+++ os.h        2006-12-20 21:30:39.612512000 -0300
@@ -133,4 +133,5 @@
 #define sqlite3OsFree               sqlite3GenericFree
 #define sqlite3OsAllocationSize     sqlite3GenericAllocationSize
+HANDLE sqlite3WinLoadLibrary(const char*);
 #endif
 #if OS_OS2


--- ..\sqlite-source-3_3_8.orig\os_win.c        2006-10-08 13:51:00.000000000 
-0300
+++ os_win.c    2006-12-20 21:32:25.464720000 -0300
@@ -1556,3 +1556,23 @@
   return pTsd;
 }
+
+/*
+** Return TRUE if the named file exists.
+*/
+HANDLE sqlite3WinLoadLibrary(const char *zFilename){
+  HANDLE h = NULL;
+  WCHAR *zWide = utf8ToUnicode(zFilename);
+  if( zWide ){
+    h = LoadLibraryW(zWide);
+    sqliteFree(zWide);
+  }else{
+#if OS_WINCE
+    return NULL;
+#else
+    h = LoadLibraryA(zFilename);
+#endif
+  }
+  return h;
+}
+
 #endif /* OS_WIN */


--- ..\sqlite-source-3_3_8.orig\loadext.c 2006-10-08 13:51:00.000000000 -0300
+++ loadext.c   2006-12-20 21:28:19.420926400 -0300
@@ -224,5 +224,5 @@
 # include <windows.h>
 # define SQLITE_LIBRARY_TYPE     HANDLE
-# define SQLITE_OPEN_LIBRARY(A)  LoadLibrary(A)
+# define SQLITE_OPEN_LIBRARY(A)  sqlite3WinLoadLibrary(A)
 # define SQLITE_FIND_SYMBOL(A,B) GetProcAddress(A,B)
 # define SQLITE_CLOSE_LIBRARY(A) FreeLibrary(A)


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to