Jean-Denis MUYS <jdm...@kleegroup.com> wrote:
> int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int 
> str2Length, const void *str2) {
>
> But maybe you have good reasons to ignore the Apple-provided collations. In 
> that case, I still don't get why you don't work
> directly on the Unicode strings. You call hexStringWithData:ofLength: (which 
> is not an Apple method and for which you don't
> provide the code). Why? What would be wrong with:  
> 
> NSString *strA = [[NSString alloc] initWithUTF8String:str1]; // release me 
> before returning
> NSString *strB = [[NSString alloc] initWithUTF8String:str2]; // release me 
> before returning

str1 and str2 are UTF-16 strings, not UTF-8 strings (since the OP passed 
SQLITE_UTF16 flag to sqlite3_create_collation; if UTF-8 strings are more 
convenient to work with, he could have passed SQLITE_UTF8 instead). Further, 
the strings may not be NUL-terminated, that's why you are given their lengths.
-- 
Igor Tandetnik

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

Reply via email to