Re: [sqlite] Need a wince test

2006-12-21 Thread Nuno Lucas
On 12/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Uwe Sander [EMAIL PROTECTED] wrote: Hi, Am Donnerstag, 21. Dezember 2006 04:03 schrieb [EMAIL PROTECTED]: My compiler does not define CP_OEM. Can somebody please tell me what the literal value of that macro is? I think, the name

Re: [sqlite] Need a wince test

2006-12-20 Thread Nuno Lucas
On 12/20/06, Brodie Thiesfield [EMAIL PROTECTED] wrote: +static HANDLE loadLibraryUtf8(const char *z){ + WCHAR zWide[MAX_PATH]; + DWORD dwLen = MultiByteToWideChar(CP_UTF8,0,z,-1,zWide,MAX_PATH); + if (dwLen == 0 || dwLen MAX_PATH) return NULL; + return LoadLibraryW(zWide); +} I can't

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 9:17 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test There are a few problems with your patch. +# ifdef _WIN32_WCE +static HANDLE loadLibraryUtf8

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
Robert, does the patch I provided work as is on Windows CE or not? Robert Simpson wrote: There's some flaws in your arguments, Brodie ... 1. There's no need to do this whole _UNICODE test, only the _WINCE test is needed. All versions of Windows that support unicode also support the ANSI

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Brodie Thiesfield [EMAIL PROTECTED] wrote: As far as I understand, sqlite changed sometime in the early 3.0 versions such that char* strings (input and output) are always assumed to be UTF-8. [...] Yes. But this is a separate problem. Look at the code in os_win.c, e.g.

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
[EMAIL PROTECTED] wrote: Brodie Thiesfield [EMAIL PROTECTED] wrote: [...] SQLite should never expect strings in any encoding other than UTF-8 or UTF-16. (Note that ASCII is a proper subset of UTF-8 so SQLite will also accept ASCII.) I do not know what CP_ACP is, but if it is not a subset

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 20, 2006 12:17 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test Robert, does the patch I provided work as is on Windows CE or not? Robert Simpson wrote: There's

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
Robert Simpson wrote: From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Robert, you are missing the point. Because of the way this is being defined, there is a need to check for _UNICODE. If you don't then a build with _UNICODE defined will fail. If it was implemented like the rest of the

RE: [sqlite] Need a wince test

2006-12-20 Thread Robert Simpson
-Original Message- From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 20, 2006 4:43 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Need a wince test Robert Simpson wrote: From: Brodie Thiesfield [mailto:[EMAIL PROTECTED] Robert, you are missing

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
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:

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
win95/nt/ce users, please test check-in [3541] to see if extension loading now works on wince and to make sure that nothing broke on win95/nt. Tnx. http://www.sqlite.org/cvstrac/chngview?cn=3541 -- D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] Need a wince test

2006-12-20 Thread Brodie Thiesfield
The utf8ToUnicode function uses MultiByteToWideChar(CP_UTF8) which it seems from recent comments isn't supported on all versions of Windows CE. This may need to be changed to use the internal UTF-8 to UTF-16 conversion routines. To be safe, the unicodeToMbcs needs to determine which codepage to

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Brodie Thiesfield [EMAIL PROTECTED] wrote: To be safe, the unicodeToMbcs needs to determine which codepage to convert to in the WideCharToMultiByte calls. This is done by calling the AreFileApisANSI() http://snipurl.com/arefileapisansi like: UINT codepage = AreFileApisANSI() ? CP_ACP :

Re: [sqlite] Need a wince test

2006-12-20 Thread Uwe Sander
Hi, Am Donnerstag, 21. Dezember 2006 04:03 schrieb [EMAIL PROTECTED]: My compiler does not define CP_OEM. Can somebody please tell me what the literal value of that macro is? I think, the name of the constant is CP_OEMCP, its value is 1. Don't have a CP_OEM on my disk. - Uwe

Re: [sqlite] Need a wince test

2006-12-20 Thread drh
Uwe Sander [EMAIL PROTECTED] wrote: Hi, Am Donnerstag, 21. Dezember 2006 04:03 schrieb [EMAIL PROTECTED]: My compiler does not define CP_OEM. Can somebody please tell me what the literal value of that macro is? I think, the name of the constant is CP_OEMCP, Yes. I figured that out

[sqlite] Need a wince test

2006-12-19 Thread drh
Can somebody with access to wince please test patch [3537] for me and let me know if it works to fix ticket #2023. http://www.sqlite.org/cvstrac/chngview?cn=3537 http://www.sqlite.org/cvstrac/tktview?tn=2023 -- D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] Need a wince test

2006-12-19 Thread Brodie Thiesfield
There are a few problems with your patch. +# ifdef _WIN32_WCE +static HANDLE loadLibraryUtf8(const char *z){ + WCHAR zWide[MAX_PATH]; + MultiByteToWideChar(CP_ACP,0,z,-1,zWide,MAX_PATH); + return LoadLibrary(zWide); +} +# define SQLITE_OPEN_LIBRARY(A) loadLibraryUtf8(A)