Last active
July 2, 2018 06:36
-
-
Save lostsnow/9283dcf0481dc6c6a0e5885586592712 to your computer and use it in GitHub Desktop.
Translate sent text GBK into UTF-8
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
<?xml version="1.0" encoding="iso-8859-1"?> | |
<!DOCTYPE muclient> | |
<muclient> | |
<plugin | |
name="Translate_GBK_TO_UTF8" | |
author="lostsnow" | |
id="b5d6c2e22177e7a13b081a29" | |
language="Lua" | |
purpose="Translate sent text GBK into UTF-8" | |
date_written="2018-07-02 13:19:26" | |
requires="4.25" | |
version="1.0" | |
> | |
</plugin> | |
<!-- Script --> | |
<script> | |
<![CDATA[ | |
function OnPluginSend (sText) | |
assert (package.loadlib ("luaiconv.dll", "luaopen_iconv")) () | |
local cd = iconv.open("UTF-8", "GBK") | |
local nstr, err = cd:iconv(sText) | |
Send ((nstr)) | |
return false | |
end -- OnPluginSend | |
]]> | |
</script> | |
</muclient> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment