--
-- Applies low level quoting to a string (escaping characters which are illegal
-- to appear in an IRC packet).
--
-- Applies low level quoting to a string (escaping characters which are illegal
-- to appear in an IRC packet).
--
-- Applies CTCP quoting to a block of text which has been identified as CTCP
-- data (by the calling program).
--
-- Applies CTCP quoting to a block of text which has been identified as CTCP
-- data (by the calling program).
local ret = str:gsub("[\001\\]", {["\001"] = "\\a",
["\\"] = "\\\\"})
return "\001" .. ret .. "\001"
local ret = str:gsub("[\001\\]", {["\001"] = "\\a",
["\\"] = "\\\\"})
return "\001" .. ret .. "\001"