>>>   int r = _wcsnicmp((const wchar_t *)a, (const wchar_t *)b,
>>>     (alen < blen) ? alen : blen);
> 
> Maybe the length is still wrong. The lengths passed to an sqlite
> collation sequence callback are in bytes. But _wcsnicmp() is
> probably in characters, no?
> 
> 

That was it!  It seems to work now.

// new code
int r = _wcsnicmp((const wchar_t *)a, (const wchar_t *)b,
   ((alen < blen) ? alen : blen) / sizeof(wchar_t));

Is the fact that the callback strings are not NUL terminated and the 
lengths are in bytes documented anywhere?  If not, it might be a good 
idea.  If they are documented, can someone point me to the url?  I would 
like to see if there are any other gotchas before relying on this.

csmith
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to