File tree Expand file tree Collapse file tree 1 file changed +8
-24
lines changed
tools/cldr-apps/src/main/java/org/unicode/cldr/web Expand file tree Collapse file tree 1 file changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -291,34 +291,18 @@ public String field(String x, String def) {
291291 }
292292
293293 /*
294- * Decode a single string from URL format into Unicode
294+ * Return the input string, unchanged
295295 *
296- * @param res UTF-8 'encoded' bytes (expanded to a string)
296+ * This method no longer serves any purpose since CLDR now requires UTF-8 encoding
297+ * for all http requests and related services/configuration.
297298 *
298- * @return Unicode string (will return 'res' if no high bits were detected)
299+ * This method is temporarily retained for compatibility with legacy code including .jsp.
300+ *
301+ * @param res the string
302+ *
303+ * @return the string
299304 */
300305 public static String decodeFieldString (String res ) {
301- if (res == null )
302- return null ;
303- byte [] asBytes = new byte [res .length ()];
304- boolean wasHigh = false ;
305- int n ;
306- for (n = 0 ; n < res .length (); n ++) {
307- asBytes [n ] = (byte ) (res .charAt (n ) & 0x00FF );
308- // println(" n : " + (int)asBytes[n] + " .. ");
309- if (asBytes [n ] < 0 ) {
310- wasHigh = true ;
311- }
312- }
313- if (!wasHigh ) {
314- return res ; // no utf-8
315- }
316- try {
317- res = new String (asBytes , StandardCharsets .UTF_8 );
318- } catch (Throwable t ) {
319- return res ;
320- }
321-
322306 return res ;
323307 }
324308
You can’t perform that action at this time.
0 commit comments