Skip to content

Commit 1488029

Browse files
committed
Cherry pick branch 'genexuslabs:accentsInURLHttpClient' into beta
1 parent ac92229 commit 1488029

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

common/src/main/java/com/genexus/CommonUtil.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import java.math.BigDecimal;
1010
import java.io.*;
11+
import java.net.URLEncoder;
1112
import java.text.*;
1213
import 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;

0 commit comments

Comments
 (0)