File tree Expand file tree Collapse file tree
packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646import java .io .FileDescriptor ;
4747import java .io .FileNotFoundException ;
4848import java .io .IOException ;
49+ import java .util .Locale ;
4950import java .util .concurrent .Executor ;
5051import java .util .concurrent .Executors ;
5152
@@ -728,19 +729,25 @@ public void run() {
728729 }
729730
730731 public static String stringToUpperCase (final String value ) {
731- return value .toUpperCase ();
732+ if (value == null || value .isEmpty ()) {
733+ return value ;
734+ }
735+ return value .toUpperCase (Locale .getDefault ());
732736 }
733737
734738 public static String stringToLowerCase (final String value ) {
735- return value .toLowerCase ();
739+ if (value == null || value .isEmpty ()) {
740+ return value ;
741+ }
742+ return value .toLowerCase (Locale .getDefault ());
736743 }
737744
738745 public static String capitalizeString (final String value ) {
739746 if (value == null || value .isEmpty ()) {
740747 return value ;
741748 }
742749
743- final char [] buffer = value .toLowerCase ().toCharArray ();
750+ final char [] buffer = value .toLowerCase (Locale . getDefault () ).toCharArray ();
744751 boolean capitalizeNext = true ;
745752
746753 for (int i = 0 ; i < buffer .length ; i ++) {
You can’t perform that action at this time.
0 commit comments