views:

65

answers:

1

Other than to convert to UTF-8 bytes, or write a compare function that iterates and compares, is there some method I'm missing in JDK 1.6 that compares two strings in full Unicode codepoint order instead of in UCS-2 codepoint order?

I appreciate that this is not a hard thing to code. I was puzzled, however, that 1.6 has the various 'codepoint' APIs in java.lang.String as well as the Collation system, but apparently nothing to simply compare two strings without hiccuping on the surrogates.

For the benefit of a commenter, I have to feed some data to a tool that wants the strings in this order.

+1  A: 

AFAIk, the API has no such method, but it should be trivial to implement it yourself. Just out of curiosity: What do you need something like that for?

jarnbjo