Merge Upstream (luautf8 benötigt!!!)

This commit is contained in:
Andreas Bielawski
2016-09-05 13:59:57 +02:00
3 changed files with 50 additions and 21 deletions

View File

@ -20,6 +20,7 @@
local utilities = {}
utf8 = require 'lua-utf8'
ltn12 = require('ltn12')
http = require('socket.http')
https = require('ssl.https')
@ -1097,4 +1098,10 @@ function is_channel_disabled(msg)
return disabled
end
-- Converts a gross string back into proper UTF-8.
-- Useful for fixing improper encoding caused by bad JSON escaping.
function utilities.fix_utf8(str)
return string.char(utf8.codepoint(str, 1, -1))
end
return utilities