Sergey Fedorov
Sergey Fedorov

Reputation: 2169

What must be toLowerCase(Locale) output?

There is String.toLowerCase(Locale) method in java. There are some difficulties (some of them described here) that make result of this method not so obvious in case of languages like Greek and Turkish. The question is: are there any "specification" that would tell me the result of toLowerCase if I give it input string and Locale to be used? Are there tables like upper->lower digits, some rule to find it out or something else?

Please don't advice just to compile/run code with some string. This is the question is about specification details (how must it work, not how does it work)

Upvotes: 0

Views: 82

Answers (1)

david.pfx
david.pfx

Reputation: 10853

The relevant standard now is Unicode. All the information you need is encoded in the Unicode standard and the code points and attributes it describes. All the rules are in there. This answers your question, but it doesn't mean that it will be easy to understand or use.

You might start here: http://www.unicode.org/faq/casemap_charprop.html.

Edit: This should not be taken to say that the Unicode standard includes everything known about case mapping. It is simply the case that, as far as I am aware, this is the only standard and all other authorities defer to this one. If it isn't found here, it hasn't been standardised yet.

Upvotes: 2

Related Questions