Nicolas Williams <nicolas.willi...@sun.com> wrote: > On Tue, Nov 17, 2009 at 02:01:55PM -0500, Igor Tandetnik wrote: >> This would mean that the result of the hypothetical flip() function >> would be locale-dependent. E.g. in Spanish Traditional sort, a >> combination 'ch' sorts as if it were a single letter between 'c' and >> 'd', forming a single sort element (a so-called contraction). So >> should 'a ch b' reverse to 'b ch a' under Spanish Traditional sort, >> and to 'b hc a' otherwise? Would you pass a desired locale as a >> parameter to flip(), in order to achieve that? > > This is no longer true, either of 'ch' nor 'll'.
There is a number of contractions in Hungarian that are still very much in use, but I can't recall them off the top of my head the way I can 'ch' (it's something like 'dzs'). There are also contractions in German Phonebook sort (e.g. 'oe' should sort between 'o with umlaut' and 'p', if I recall correctly). There are likely other cases. > The principle you > state is correct, of course, but really, this is a collation problem, > and affects SQLite3 apps regardless of "flip()". My point is, it's difficult to even define what the correct behavior of flip() should be, let alone implement one. And so the safest course of action is to leave it out of core SQLite: a developer in need of such a function would presumably know the nature of their data and precisely what they want the function to achieve, and can always implement it as a custom function. > The collation is > per-column, and the run-time should make functions aware of the > collation (if any) of a column when an argument. What about select flip(EnglishText || GermanText || SpanishText) from MyMultilingualTable; Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users