Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Tue, 2012-05-01 at 22:26 +0200, Muhammad Haggag wrote:
Is it OK to break Unicode equivalence
(http://en.wikipedia.org/wiki/Unicode_equivalence) by doing a memory
comparison?

Yeah, because the existing code doesn't pay any attention to stuff like
that. Presumably we wave a magic wand somewhere and claim that
everything inside a given boundary is in some normalized form :-)

 (I assume ICU does proper comparisons taking equivalence
into account, hence why it's slow).

nah, it just loops over all the chars like so...

 do {
   result = ((int32_t)*(chars++) - (int32_t)*(srcChars++));
   if(result != 0) {
     return (int8_t)(result >> 15 | 1);
   }
 } while(--minLength > 0);

new code is equivalent for the equal/non-equal case

C.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.