starlit  Diff

Differences From Artifact [ded7121fc6]:

  • File mods/vtlib/str.lua — part of check-in [953151446f] at 2024-05-05 19:31:39 on branch trunk — better alarm LEDs, continue work on matter compiler UI, hack around gravitational horrorscape (i.e. stop shitting all over the server's `minetest.conf`), better stat interface, tweak some compute stats, be more generous with starting battery loadout, mercilessly squash numberless bugs beneath my jackbooted heel (user: lexi, size: 5957) [annotate] [blame] [check-ins using]

To Artifact [b2f5363bf4]:


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