mirror of
https://github.com/mt-mods/led_marquee.git
synced 2024-11-28 01:53:47 +01:00
Merge branch 'bad_unicode' into 'master'
add check to prevent bad unicode from crashing the server See merge request VanessaE/led_marquee!4
This commit is contained in:
commit
8d3a0e92de
7
init.lua
7
init.lua
@ -128,7 +128,12 @@ local make_iso = function(s)
|
|||||||
local s2 = ""
|
local s2 = ""
|
||||||
while i <= string.len(s) do
|
while i <= string.len(s) do
|
||||||
if string.byte(s,i) > 159 then
|
if string.byte(s,i) > 159 then
|
||||||
s2 = s2..string.char(get_iso(string.sub(s, i, i+1)))
|
local ciso = get_iso(string.sub(s, i, i+1))
|
||||||
|
if ciso >= 0 and ciso < 256 then
|
||||||
|
s2 = s2..string.char(ciso)
|
||||||
|
else
|
||||||
|
s2 = s2..string.char(127)
|
||||||
|
end
|
||||||
i = i + 2
|
i = i + 2
|
||||||
else
|
else
|
||||||
s2 = s2..string.sub(s, i, i)
|
s2 = s2..string.sub(s, i, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user