function Util.ParseEscapeSequences(b)return((b:gsub("\092\040\046\041",{t="\t";n="\n"})):gsub("\092\117\040\037\120\037\120\037\120\037\120\041",charCode)):gsub("\092\120\040\037\120\037\120\041",charCode)end local function b(b)return first(((b:gsub("\092\092",string.char(17))):gsub("\092\"",string.char(18))):gsub("\092\'",string.char(19)))end local function P(b)return first(((b:gsub(string.char(17),"\092")):gsub(string.char(18),"\"")):gsub(string.char(19),"\'"))end

function Util.ParseEscapeSequences(text)
	return text:gsub("\\(.)", {
		t = "\t";
		n = "\n";
	})
	:gsub("\\u(%x%x%x%x)", charCode)
	:gsub("\\x(%x%x)", charCode)
end

local function encodeControlChars(text)
	return first(
		text
		:gsub("\\\\", string.char(17))
		:gsub("\\\"", string.char(18))
		:gsub("\\'", string.char(19))
	)
end

local function decodeControlChars(text)
	return first(
		text
		:gsub(string.char(17), "\\")
		:gsub(string.char(18), "\"")
		:gsub(string.char(19), "'")
	)
end
