
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Failure to specify a locale for ``++String++`` case conversions means the system default encoding will be used, possibly creating problems with international characters. Such code may work fine in its "home" environment, but break in ways that are extremely difficult to diagnose for customers who use different encodings. Such bugs can be nearly, if not completely, impossible to reproduce when it's time to fix them.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,html]
|
|
----
|
|
String myStr = "José is a nice guy.";
|
|
String myUcString = myStr.toUpperCase(); // Noncompliant
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,html]
|
|
----
|
|
String myStr = "José is a nice guy.";
|
|
String myUcString = myStr.toUpperCase(Locale.US);
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== duplicates: S1449
|
|
|
|
=== on 10 Oct 2014, 11:45:49 Freddy Mallet wrote:
|
|
@Ann, this ticket duplicates RSPEC-1449, either delete RSPEC-1449 or this ticket. Moreover, I would mention the fact that this is useful only for few kind of locales.
|
|
|
|
endif::env-github,rspecator-view[]
|