[sc34wg3] TMQL: Operators "Not equal"

Lars Marius Garshol larsga at garshol.priv.no
Tue Oct 30 06:03:28 EDT 2007


* Inge Henriksen
>
> How will different Unicode characters be handled when it comes to
> comparing? When see the "==" operator I assume a binary comparison,  
> but
> should these kinds of operators be used when comparing text's? If you
> say
>
>   select $p / name
>   where
>      $p isa person
>   &  $p / homepage == "http://myspace.com/"
>
> where each side of the operator is of a different Unicode character  
> set
> then they are not binary equal but they may still be equal from a
> culture-insensitive standpoint.

All strings are sequences of Unicode characters. So there is no  
notion of character encoding. (Of course, in implementations there  
is, but all strings will have the same encoding.)

String comparison is just dumb character-by-character equality  
testing. Anything more complex is really a can of worms, and should  
be avoided.

This is one area where extension functions are going to be useful.

--Lars M.


More information about the sc34wg3 mailing list