Re: [sqlite] Custom Collation comparing only firt character?

2011-08-29 Thread Igor Tandetnik
Jean-Denis MUYS 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. Y

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-29 Thread Jean-Denis MUYS
On 25 août 2011, at 07:58, Roberto Colnaghi wrote: int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int str2Length, const void *str2) { NSString *strA = [NSString hexStringWithData:str1 ofLength:1]; NSString *strB = [NSString hexStringWithData:str2 ofLength:1]; int striA; sscan

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-27 Thread Jean-Christophe Deschamps
>Cool - can you please post a link to the sources? Sure, here you are: http://dl.dropbox.com/u/26433628/unifuzz.zip The .c source contains all details (and all the bugs). -- j...@antichoc.net ___ sqlite-users mailing list sq

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-26 Thread Stephan Beal
On Sat, Aug 27, 2011 at 12:04 AM, Jean-Christophe Deschamps < j...@antichoc.net> wrote: > If you also need to search names with uncertain spelling, you can also > use my typos() function to perform a fuzzy search. Here's a sample of > its use on a decently populated ZipCodes table (848207 rows):

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-26 Thread Jean-Christophe Deschamps
Roberto, >Though I cannot use DLLs since it is an iPhone iOS (MacOSX) >operational system. I made it DLL by default at build time since it fits my needs. You can still compile the extension (or part of it) as a standard .o obj and statically link it into your application. >I was hoping for a

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-26 Thread Igor Tandetnik
Roberto Colnaghi wrote: > Thank you for your detailed reply. > Though I cannot use DLLs since it is an iPhone iOS (MacOSX) operational > system.I was hoping for a collation callback that is > called for all characters, not only the first. It is. What do you think str1Length and str2Length param

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-26 Thread Roberto Colnaghi
Date: Thu, 25 Aug 2011 13:30:57 +0200 To: colna...@msn.com From: j...@antichoc.net Subject: Re: [sqlite] Custom Collation comparing only firt character? Hi Roberto, It all depends on your data source(s). If you're sure you have all accented codepoints dealt whith in your custom collation,

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 6:58am, Roberto Colnaghi wrote: > int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int > str2Length, const void *str2) { > NSString *strA = [NSString hexStringWithData:str1 ofLength:1]; > NSString *strB = [NSString hexStringWithData:str2 ofLength:

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Michael Stephenson
om: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roberto Colnaghi Sent: Thursday, August 25, 2011 1:59 AM To: sqlite-users@sqlite.org Subject: [sqlite] Custom Collation comparing only firt character? Hi, I'm using iOS SQLite with a custom co

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Igor Tandetnik
Roberto Colnaghi wrote: > It works though only the FIRST character seems to be compared instead of the > whole "Name". > Is there anything missing here? > > int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int > str2Length, const void *str2) { > NSString *strA = [NSString hexS

[sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Roberto Colnaghi
Hi, I'm using iOS SQLite with a custom collation. I've registered it: sqlite3_create_collation(sqlDatabase, "anyCIAI", SQLITE_UTF16, nil, collatio