From d673f8d15c4031006c3b624af674bb66b4749cdf Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Tue, 1 Oct 2013 03:42:55 +1300 Subject: [PATCH] Added escape and unescape --- plugins/utility.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/utility.py b/plugins/utility.py index 84cb92c..ad9e6df 100644 --- a/plugins/utility.py +++ b/plugins/utility.py @@ -30,7 +30,6 @@ def swapcase(inp): """swapcase -- Swaps the capitalization of .""" return inp.swapcase() - # encoding @hook.command @@ -38,6 +37,16 @@ def rot13(inp): """rot13 -- Encode with rot13.""" return inp.encode('rot13') +@hook.command +def unescape(inp): + """unescape -- Unescapes .""" + return inp.decode('unicode-escape') + +@hook.command +def escape(inp): + """escape -- escapes .""" + return inp.encode('unicode-escape') + # length @hook.command