Skip to content

Commit 6322936

Browse files
committed
When converting to upper case to match English constants, use
Locale.English or things will go wrong when running on the Turkish locale. See http://mattryall.net/blog/2009/02/the-infamous-turkish-locale-bug and other Google results: https://www.google.com/search?q=java+toUpperCase+turkish&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
1 parent c56496c commit 6322936

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jansi/src/main/java/org/fusesource/jansi/AnsiRenderer.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.fusesource.jansi;
1818

19+
import java.util.Locale;
20+
1921
import org.fusesource.jansi.Ansi.Attribute;
2022
import org.fusesource.jansi.Ansi.Color;
2123

@@ -102,7 +104,7 @@ static public String render(final String input) throws IllegalArgumentException
102104
static private String render(final String text, final String... codes) {
103105
Ansi ansi = Ansi.ansi();
104106
for (String name : codes) {
105-
Code code = Code.valueOf(name.toUpperCase());
107+
Code code = Code.valueOf(name.toUpperCase(Locale.ENGLISH));
106108

107109
if (code.isColor()) {
108110
if (code.isBackground()) {

0 commit comments

Comments
 (0)