File tree Expand file tree Collapse file tree
common/src/main/java/com/genexus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import java .math .BigDecimal ;
1010import java .io .*;
11+ import java .net .URLEncoder ;
1112import java .text .*;
1213import java .util .*;
1314
@@ -3219,9 +3220,17 @@ public final static String escapeUnsafeChars(String path)
32193220 char ch = path .charAt (src );
32203221 if (ch >= 128 || UnsafeChar .get (ch ))
32213222 {
3222- buf [dst ++] = '%' ;
3223- buf [dst ++] = hex_map [(ch & 0xf0 ) >>> 4 ];
3224- buf [dst ++] = hex_map [ch & 0x0f ];
3223+ try
3224+ {
3225+ String encoded = URLEncoder .encode ( Character .toString (ch ), "UTF-8" );
3226+ for (int i = 0 ; i < encoded .length (); i ++)
3227+ buf [dst ++] = encoded .charAt (i );
3228+ }
3229+ catch (UnsupportedEncodingException e )
3230+ {
3231+ logger .debug ("Error while encoding unsafe char in escapeUnsafeChars: " , e );
3232+ buf [dst ++] = ch ;
3233+ }
32253234 }
32263235 else
32273236 buf [dst ++] = ch ;
You can’t perform that action at this time.
0 commit comments