I have this line in a Lua script that crash my software every time:
fmt_url_map = string.gsub( fmt_url_map, '%2F','/' )
I want to replace all occurrences of %2F occurrences in a text to /.
If I remove the % , it doesn’t crash.
What am I doing wrong ?
%is a special symbol in Lua patterns. It’s used to represent certain sets of characters, (called character classes). For example,%arepresents any letter. If you want to literally match%you need to use%%. See this section of the Lua Reference Manual for more information. I suspect you’re running into problems because%Fis not a character class.