> > 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 >
I appreciate everyone's help with this issue. The below documentation is from here http://www.sqlite.org/c3ref/create_collation.html "The remaining arguments to the application-supplied routine are two strings, each represented by a (length, data) pair and encoded in the encoding that was passed as the third argument when the collation sequence was registered." May I suggest: "...are two strings, excluding NULs, each represented by a (length in bytes not chars, data) pair and encoded..." That would most likely clear up any confusion. When I read that paragraph initially, "two strings" made me think NUL terminated. When I think string in C I think NUL terminated. The "(length, data) pair encoded" part made me think that the length matched the encoding; meaning character count. Once again, thanks for helping me out. csmith _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users