mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-06-22 20:24:36 +02:00
Fix order of arguments in 'open'
Since they were wrong in two places, there is no API changes, just a readability fix.
This commit is contained in:
parent
e9f3a5e377
commit
30fdc3c192
@ -7,10 +7,9 @@ local m = { }
|
|||||||
local mti = { }
|
local mti = { }
|
||||||
local mt = { __index = mti }
|
local mt = { __index = mti }
|
||||||
|
|
||||||
function m.open(fname, mode, fromcharset, tocharset)
|
function m.open(fname, mode, tocharset, fromcharset)
|
||||||
assert(mode == "r" or mode == "rb", "Only read modes are supported yet")
|
assert(mode == "r" or mode == "rb", "Only read modes are supported yet")
|
||||||
tocharset = tocharset or "utf8"
|
local cd = assert(iconv.new(tocharset, fromcharset), "Bad charset")
|
||||||
local cd = assert(iconv.new(fromcharset, tocharset), "Bad charset")
|
|
||||||
local fp = io.open(fname, mode)
|
local fp = io.open(fname, mode)
|
||||||
if not fp then
|
if not fp then
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user