File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/main/java/com/github/underscore Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1945,7 +1945,7 @@ public byte[] blob() {
19451945
19461946 public String text () {
19471947 try {
1948- return stream .toString ("UTF-8" );
1948+ return stream .toString (StandardCharsets . UTF_8 . name () );
19491949 } catch (java .io .UnsupportedEncodingException ex ) {
19501950 throw new UnsupportedOperationException (ex );
19511951 }
Original file line number Diff line number Diff line change @@ -1515,8 +1515,9 @@ private static String unescapeName(final String name) {
15151515 StringBuilder result = new StringBuilder ();
15161516 int underlineCount = 0 ;
15171517 StringBuilder lastChars = new StringBuilder ();
1518+ int i = 0 ;
15181519 outer :
1519- for ( int i = 0 ; i < length ; ++ i ) {
1520+ while ( i < length ) {
15201521 char ch = name .charAt (i );
15211522 if (ch == '_' ) {
15221523 lastChars .append (ch );
@@ -1535,6 +1536,7 @@ private static String unescapeName(final String name) {
15351536 i = j ;
15361537 underlineCount = 0 ;
15371538 lastChars .setLength (0 );
1539+ i ++;
15381540 continue outer ;
15391541 }
15401542 } else {
@@ -1546,6 +1548,7 @@ private static String unescapeName(final String name) {
15461548 result .append (lastChars ).append (ch );
15471549 lastChars .setLength (0 );
15481550 }
1551+ i ++;
15491552 }
15501553 return result .append (lastChars ).toString ();
15511554 }
You can’t perform that action at this time.
0 commit comments