mirror of
https://github.com/mt-mods/signs_lib.git
synced 2024-11-15 22:20:18 +01:00
Fix style of multi-value assignments
This commit is contained in:
parent
3f1a8fa3f2
commit
46a12c0012
10
encoding.lua
10
encoding.lua
|
@ -278,7 +278,7 @@ function signs_lib.Utf8ToAnsi(s)
|
||||||
if scope[b] then
|
if scope[b] then
|
||||||
scope = scope[b]
|
scope = scope[b]
|
||||||
if "string" == type(scope) then
|
if "string" == type(scope) then
|
||||||
r, scope = r .. scope
|
r, scope = r .. scope, nil
|
||||||
j = -1 -- supress general UTF-8 parser
|
j = -1 -- supress general UTF-8 parser
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -290,11 +290,11 @@ function signs_lib.Utf8ToAnsi(s)
|
||||||
|
|
||||||
-- general UTF-8 parser
|
-- general UTF-8 parser
|
||||||
if j == -1 then -- supressed by legacy parser
|
if j == -1 then -- supressed by legacy parser
|
||||||
j, l, u = nil
|
j = nil
|
||||||
elseif b < 0x80 then
|
elseif b < 0x80 then
|
||||||
if j then
|
if j then
|
||||||
r = r .. "&#ufffd;"
|
r = r .. "&#ufffd;"
|
||||||
j, l, u = nil
|
j = nil
|
||||||
end
|
end
|
||||||
-- ASCII handled by legacy parser
|
-- ASCII handled by legacy parser
|
||||||
elseif b >= 0xc0 then
|
elseif b >= 0xc0 then
|
||||||
|
@ -304,7 +304,7 @@ function signs_lib.Utf8ToAnsi(s)
|
||||||
j = i
|
j = i
|
||||||
if b >= 0xf8 then
|
if b >= 0xf8 then
|
||||||
r = r .. "&#ufffd;"
|
r = r .. "&#ufffd;"
|
||||||
j, l, u = nil
|
j = nil
|
||||||
elseif b >= 0xf0 then
|
elseif b >= 0xf0 then
|
||||||
l, u = 4, b % (2 ^ 3)
|
l, u = 4, b % (2 ^ 3)
|
||||||
elseif b >= 0xe0 then
|
elseif b >= 0xe0 then
|
||||||
|
@ -317,7 +317,7 @@ function signs_lib.Utf8ToAnsi(s)
|
||||||
u = u * (2 ^ 6) + b % (2 ^ 6)
|
u = u * (2 ^ 6) + b % (2 ^ 6)
|
||||||
if i == j + l - 1 then
|
if i == j + l - 1 then
|
||||||
r = r .. string.format("&#u%x;", u)
|
r = r .. string.format("&#u%x;", u)
|
||||||
j, l, u = nil
|
j = nil
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
r = r .. "&#ufffd;"
|
r = r .. "&#ufffd;"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user