After thinking a bit, it occurs to me that there's a compromise for
the Unicode case that might be workable.  The algorithm for collation
is pretty stable, it's just the locale data that's the problem.  If
SQLite understands the algorithm, then locale data can go into special
tables in the database itself.

Applications manipulating the database schema would need to have the
relevant collation data on hand to fill in the database, but other
apps concerned with only the data could operate without any special
knowledge.  This approach keeps the database internally
self-consistent while avoiding platform and versioning issues.

Something like this could probably work, but it still seems to me that
we are assigning SQLite tasks that OS or some other libraries should
handle.

Actually, reading one of the links you posted
(http://blogs.msdn.com/michkap/archive/2005/05/04/414520.aspx -
everybody please read it before continuing in discussion), I got (what
I think is a great) idea: Let's include version information about
collation algorithm we are using. So, extending my previous
suggestion, the SQLite collation title would look like
'en_AU_Win_2_1', where the individual parts mean:
'en_AU' - obviously a sort order
'Win' - that we are basing the ordering on default Windows methods
(otherwise could be e.g. 'ICU')
'2_1' - version string as retrieved from GetNLSVersion() function and
NLSVERSIONINFO struct (see the link above for details).

This way we are absolutely sure that we don't corrupt SQLite database.
While I'm working on a single system, the version string wouldn't
change. Then, e.g. if I open SQLite database with 'en_AU_Win_2_1'
collation on a system NLSVERSIONINFO returns version 2.3, I know I
have to reindex, change collation title to 'en_AU_Win_2_3' and then
can safely use the database.

It seems to me to be a really cross-platform solution and what's best
- without any coding on SQLite side necessary (even though possible to
handle some parts of this proposal internally).

Jiri

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to