What is the default purpose of String.toLowerCase ()?

Java has two overloads for String.toLowerCase and toUpperCase. One of the overloads accepts the Locale parameter as a parameter, while the other does not accept any parameters and uses the default locale ( Locale.getDefault()).

Options without parameters may not work as expected, because the case conversion takes into account internationalization, and the default locale is system-dependent. In particular, lowercase i is converted to uppercase, marked with a dot in Turkish.

What is the purpose of these methods? Do inconspicuous options have any legal possibilities? Or maybe it's just a design mistake? (Unlike several I / O APIs, which by default use the default encoding by default.)

+4
source share
3 answers

Several blog posts suggest that the default locales and encodings were indeed a design error and did not have meaningful use.

0
source

, , , , I18n, , java- .

unix java Windows, java-.

0

, write .

, JVM .

, Java runtime Dates and Numbers. (SimpleDateFormat, NumberFormat ..)

0

Source: https://habr.com/ru/post/1523920/


All Articles