mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
URL encode non-ascii characters
This commit is contained in:
parent
c7c0e1351a
commit
7aca744635
1 changed files with 6 additions and 2 deletions
|
@ -105,8 +105,12 @@ void net_http_urlencode_full(char **dest, const char *source) {
|
|||
|
||||
for (; *source; source++)
|
||||
{
|
||||
if (urlencode_lut[(int)*source]) sprintf(enc, "%c", urlencode_lut[(int)*source]);
|
||||
else sprintf(enc, "%%%02X", *source);
|
||||
/* any non-ascii character will just be encoded without question */
|
||||
if ((int)*source < sizeof(urlencode_lut) && urlencode_lut[(int)*source])
|
||||
sprintf(enc, "%c", urlencode_lut[(int)*source]);
|
||||
else
|
||||
sprintf(enc, "%%%02X", *source);
|
||||
|
||||
while (*++(enc));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue