views:

28

answers:

1

Is strcmp() appropriate for comparing ICU collator sort keys in PHP?

The sort keys I'm asking about are from collator_get_sort_key() which are described in ICU documentation.

+1  A: 

strcmp can be used if indeed it is just a binary comparison of the null terminated value.

http://userguide.icu-project.org/collation

Steven R. Loomis
I believe that's what the PHP manual means by "Binary safe string comparison". ICU docs are great but the documentation of the ICU API in PHP (which they call 'intl') is not.
fsb
Well thank you. We have a lot to work on still… I added a comment on the PHP manual page here http://www.php.net/manual/en/collator.getsortkey.php referencing this question.
Steven R. Loomis