Created
July 16, 2015 16:41
-
-
Save notsobad/be72f5abef0b5fffe7fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escapeNonePrintable(_) | |
local fmt = string.format | |
return string.gsub(_, "[%z\1-\31,\127-\255]", function (x) | |
return fmt("\\%d",string.byte(x)) | |
end) | |
end | |
print(escapeNonePrintable("a\tb\10c")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment