diff --git a/luahook.lua b/luahook.lua index 1b7dddb..c095492 100644 --- a/luahook.lua +++ b/luahook.lua @@ -37,7 +37,9 @@ ser["number"] = function(x) end ser["boolean"] = ser["number"] ser["string"] = function(x) - return string_gsub(string_format("%q", x), "\n", "n") + return string_gsub(string_format("%q", x), "%c", function(c) + return "\\00" .. string_format("%02x", string_byte(c)) + end) end ser["table"] = function(x) local arr = {}