summaryrefslogtreecommitdiff
path: root/script/encoder/init.lua
blob: a8f9a8acef800ee064db4cb4d51e1c49e8683e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local platform = require 'bee.platform'
local unicode

if platform.OS == 'Windows' then
    unicode = require 'bee.unicode'
end

local m = {}

function m.ansi2utf8(text)
    if not unicode then
        return text
    end
    return unicode.a2u(text)
end

function m.utf82ansi(text)
    if not unicode then
        return text
    end
    return unicode.u2a(text)
end

return m