Skip to content

Commit

Permalink
Cherry pick branch 'genexuslabs:accentsInURLHttpClient' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
iroqueta committed Dec 22, 2023
1 parent ac92229 commit 1488029
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions common/src/main/java/com/genexus/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.math.BigDecimal;
import java.io.*;
import java.net.URLEncoder;
import java.text.*;
import java.util.*;

Expand Down Expand Up @@ -3219,9 +3220,17 @@ public final static String escapeUnsafeChars(String path)
char ch = path.charAt(src);
if (ch >= 128 || UnsafeChar.get(ch))
{
buf[dst++] = '%';
buf[dst++] = hex_map[(ch & 0xf0) >>> 4];
buf[dst++] = hex_map[ch & 0x0f];
try
{
String encoded = URLEncoder.encode( Character.toString(ch), "UTF-8" );
for (int i = 0; i < encoded.length(); i++)
buf[dst++] = encoded.charAt(i);
}
catch (UnsupportedEncodingException e)
{
logger.debug("Error while encoding unsafe char in escapeUnsafeChars: ", e);
buf[dst++] = ch;
}
}
else
buf[dst++] = ch;
Expand Down

0 comments on commit 1488029

Please sign in to comment.