[java] making "convert to Basic Latin" intention produce uppercase Unicode escapes (IDEA-232859)

GitOrigin-RevId: 6120c9d5a5c6b3ed1fc51cfb6af5e1e2f8a75e1c
This commit is contained in:
Roman Shevchenko
2020-02-13 14:20:38 +00:00
committed by intellij-monorepo-bot
parent 4e4982d8a8
commit ed0f23ce0c
8 changed files with 12 additions and 13 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -129,7 +130,7 @@ public class ConvertToBasicLatinAction extends PsiElementBaseIntentionAction {
@Override
protected void convert(StringBuilder sb, char ch) {
sb.append(String.format("\\u%04x", (int)ch));
sb.append(String.format("\\u%04X", (int)ch));
}
}
@@ -154,7 +155,7 @@ public class ConvertToBasicLatinAction extends PsiElementBaseIntentionAction {
sb.append('&').append(entity).append(';');
}
else {
sb.append("&#x").append(Integer.toHexString(ch)).append(';');
sb.append("&#x").append(Integer.toHexString(ch).toUpperCase(Locale.ENGLISH)).append(';');
}
}
@@ -1,3 +1,3 @@
class C {
char ch = '\u00a9';
char ch = '\u00A9';
}
@@ -1,5 +1,4 @@
/**<caret>
* Copyright © 2000-2010 JetBrains s.r.o.
* Copyright © 2000 JetBrains s.r.o.
*/
class C {
}
class C { }
@@ -1,5 +1,4 @@
/**
* Copyright &copy; 2000-2010 JetBrains s.r.o.
* Copyright &copy; 2000&#x22EF; JetBrains s.r.o.
*/
class C {
}
class C { }
@@ -1,3 +1,3 @@
class C {
String s = "\u00c1\u00ee";
String s = "\u00C1\u00EE";
}
@@ -1,2 +1,2 @@
/**<caret>
* Copyright © 2000-2010 JetBrains s.r.o.
* Copyright © 2000 JetBrains s.r.o.
@@ -1,2 +1,2 @@
/**
* Copyright &copy; 2000-2010 JetBrains s.r.o.
* Copyright &copy; 2000&#x22EF; JetBrains s.r.o.
@@ -1,3 +1,3 @@
class C {
String s = "\u00c1\u00ee
String s = "\u00C1\u00EE
}