If the fields you're needing this attribute for aren't too large, the
simplest approach is to write each field twice, once "normally" and
once folded to upper case, using an algorithm you trust.  Then search
on the upper-case field.

On Feb 25, 7:10 am, Grunthos <[email protected]> wrote:
> Read some other pages maybe ;-)
>
> But thanks for the comments. Elsewhere in the  Android docs it says
> the unicode collator is case-insensitive by default. the c source
> seems to be trying to setup a level 1 collator....but...
>
> and as I said in my original post, the unicode collation *sorts* in a
> case-insensitive way. it just does not test equality in the same way
> it sorts.
>
> which seems very odd.
>
> Maybe I just don't understand unicode collation.
>
> On Feb 25, 10:36 pm, DanH <[email protected]> wrote:
>
> > That page says nothing about UNICODE doing case folding.  I would
> > interpret it as simply doing correct ordering for UTF8.
>
> > On Feb 25, 12:56 am, Philip Warner <[email protected]> wrote:
>
> > > Yes, but Android have worked around this problem by doing what the
> > > SQLite people suggest. Namely making the Unicode collator available:
>
> > >http://developer.android.com/reference/android/database/sqlite/SQLite...
>
> > > (just search the page for UNICODE).
>
> > > it's just it does not seem to be working quite right for me.
>
> > > On 25/02/2011 4:23 PM, DanH wrote:
>
> > > >http://www.sqlite.org/faq.html#q18
>
> > > > On Feb 24, 7:55 pm, Grunthos <[email protected]> wrote:
> > > >> Hi,
>
> > > >> In SQLite under Android 2.1 and 2.2 I have been using 'Collate
> > > >> UNICODE' to sort and compare values; for sorting it does what I expect
> > > >> -- it is case-insensitive, and handles the expanded character set
> > > >> well.
>
> > > >> But for comparisons, eg. f = 'something' where f is a text field, it
> > > >> seems to NOT do case-blind comparions.
>
> > > >> Specifically:
>
> > > >> On table authors(..., family_name text,...);
>
> > > >> I searched for
>
> > > >>    select * from authors a where a.family_name = 'Le Guin' Collate
> > > >> UNICODE
>
> > > >> and it returned 0 rows even though there was an entry with family_name
> > > >> = 'le Guin'.
>
> > > >> Am I missing something here? Should I be wrapping both sides of the
> > > >> '=' in a call to 'Upper()'. I thought that the UNICODE collator for
> > > >> SQLite was case-insensitive.
>
> > > >> If I do wrap both sides in calls to 'Upper()', am I correct in
> > > >> assuming indexes will not be used?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to