File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ public void remove() {
119119 */
120120 public static String escape (String string ) {
121121 StringBuilder sb = new StringBuilder (string .length ());
122- for (final int c : codePointIterator (string )) {
123- switch (c ) {
122+ for (final int cp : codePointIterator (string )) {
123+ switch (cp ) {
124124 case '&' :
125125 sb .append ("&" );
126126 break ;
@@ -137,12 +137,12 @@ public static String escape(String string) {
137137 sb .append ("'" );
138138 break ;
139139 default :
140- if (Character .isISOControl (c )) {
140+ if (Character .isISOControl (cp )) {
141141 sb .append ("&#x" );
142- sb .append (Integer .toHexString (c ));
142+ sb .append (Integer .toHexString (cp ));
143143 sb .append (";" );
144144 } else {
145- sb .append ( new String ( Character . toChars ( c )) );
145+ sb .appendCodePoint ( cp );
146146 }
147147 }
148148 }
@@ -173,7 +173,7 @@ public static String unescape(String string) {
173173 // decimal encoded unicode
174174 cp = Integer .parseInt (entity .substring (1 ));
175175 }
176- sb .append ( new String ( Character . toChars ( cp )) );
176+ sb .appendCodePoint ( cp );
177177 } else {
178178 if ("quot" .equalsIgnoreCase (entity )) {
179179 sb .append ('"' );
You can’t perform that action at this time.
0 commit comments