14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
['\xf2'] = '\2';
['\xf3'] = '\3';
['\xf4'] = '\0';
};
}
local utf8
if _G.minetest then
if minetest.global_exists 'utf8' then
utf8 = _G.utf8
end
else
utf8 = _G.utf8
end
if not utf8 then -- sigh
utf8 = {}
................................................................................
end
return str
end;
meta_armor = function(str,mark_struct)
-- binary values stored in metadata need to be sanitized so
-- they don't contain values that will disrupt parsing of the
-- KV store, as minetest (stupidly) uses in-band signalling
local sanitized = string.gsub(str, '.', function(char)
if sanitable.from[char] then
return '\xfe' .. sanitable.from[char]
else return char end
end)
if sanitized ~= str and mark_struct then
-- use different type code to mark struct headers for
|
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
['\xf2'] = '\2';
['\xf3'] = '\3';
['\xf4'] = '\0';
};
}
local utf8
if _G.core then
if core.global_exists 'utf8' then
utf8 = _G.utf8
end
else
utf8 = _G.utf8
end
if not utf8 then -- sigh
utf8 = {}
................................................................................
end
return str
end;
meta_armor = function(str,mark_struct)
-- binary values stored in metadata need to be sanitized so
-- they don't contain values that will disrupt parsing of the
-- KV store, as luanti (stupidly) uses in-band signalling
local sanitized = string.gsub(str, '.', function(char)
if sanitable.from[char] then
return '\xfe' .. sanitable.from[char]
else return char end
end)
if sanitized ~= str and mark_struct then
-- use different type code to mark struct headers for
|