mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Merge pull request #317 from johnjaylward/fixLocale
make sure locale independent data is not upper/lowercased incorrectly…
This commit is contained in:
commit
724fb888f7
2 changed files with 4 additions and 3 deletions
|
@ -25,6 +25,7 @@ SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an HTTP header to a JSONObject and back.
|
* Convert an HTTP header to a JSONObject and back.
|
||||||
|
@ -74,7 +75,7 @@ public class HTTP {
|
||||||
String token;
|
String token;
|
||||||
|
|
||||||
token = x.nextToken();
|
token = x.nextToken();
|
||||||
if (token.toUpperCase().startsWith("HTTP")) {
|
if (token.toUpperCase(Locale.ROOT).startsWith("HTTP")) {
|
||||||
|
|
||||||
// Response
|
// Response
|
||||||
|
|
||||||
|
|
|
@ -1157,9 +1157,9 @@ public class JSONObject {
|
||||||
&& Character.isUpperCase(key.charAt(0))
|
&& Character.isUpperCase(key.charAt(0))
|
||||||
&& method.getParameterTypes().length == 0) {
|
&& method.getParameterTypes().length == 0) {
|
||||||
if (key.length() == 1) {
|
if (key.length() == 1) {
|
||||||
key = key.toLowerCase();
|
key = key.toLowerCase(Locale.ROOT);
|
||||||
} else if (!Character.isUpperCase(key.charAt(1))) {
|
} else if (!Character.isUpperCase(key.charAt(1))) {
|
||||||
key = key.substring(0, 1).toLowerCase()
|
key = key.substring(0, 1).toLowerCase(Locale.ROOT)
|
||||||
+ key.substring(1);
|
+ key.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue