mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
URL encode non-ascii characters
This commit is contained in:
parent
c7c0e1351a
commit
7aca744635
@ -105,8 +105,12 @@ void net_http_urlencode_full(char **dest, const char *source) {
|
|||||||
|
|
||||||
for (; *source; source++)
|
for (; *source; source++)
|
||||||
{
|
{
|
||||||
if (urlencode_lut[(int)*source]) sprintf(enc, "%c", urlencode_lut[(int)*source]);
|
/* any non-ascii character will just be encoded without question */
|
||||||
else sprintf(enc, "%%%02X", *source);
|
if ((int)*source < sizeof(urlencode_lut) && urlencode_lut[(int)*source])
|
||||||
|
sprintf(enc, "%c", urlencode_lut[(int)*source]);
|
||||||
|
else
|
||||||
|
sprintf(enc, "%%%02X", *source);
|
||||||
|
|
||||||
while (*++(enc));
|
while (*++(enc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user