Hello

It looks like there's a problem on WinCE operating system with the 
utf8ToUnicode() / unicodeToUtf8() conversion functions. No database 
can be opened by sqlite3_open() because thehes functions fail.

Please have a look what happens there (location: os_win.c :)
/*
** 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){    // ->->-> 
zFilename is "mydatabase.db"
  int nChar;
  WCHAR *zWideFilename;

  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);  
// ->->-> returns 0 here
  zWideFilename = sqliteMalloc( nChar*sizeof(zWideFilename[0]) );   
// ->->-> returns null pointer
  if( zWideFilename==0 ){
    return 0;                                                                   
  // ->->-> leaves function here
  }
  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, 
zWideFilename, nChar);
  if( nChar==0 ){
    sqliteFree(zWideFilename);
    zWideFilename = 0;
  }
  return zWideFilename;
}

If I use the CP_ACP flag, everthing works ok:
nChar = MultiByteToWideChar(CP_ACP, 0, zFilename, -1, NULL, 0);

Same failure probably in unicodeToUtf8() because it uses 
"WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, 0, 0, 0, 0);"

My question:
Is this a bug or is something wrong with my WinCE-Image?

Version information
SQLite 3.3.17 (also tried 3.3.13 and failed)
WinCE 5.0


Regards
Daniel




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

Reply via email to