From 30fdc3c19285c08bf1c6790ef3060cda1006ee7b Mon Sep 17 00:00:00 2001 From: Alexandre Erwin Ittner Date: Wed, 17 Nov 2010 12:43:33 -0200 Subject: [PATCH] Fix order of arguments in 'open' Since they were wrong in two places, there is no API changes, just a readability fix. --- uniopen.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uniopen.lua b/uniopen.lua index 3cad233..3bdd43f 100644 --- a/uniopen.lua +++ b/uniopen.lua @@ -7,10 +7,9 @@ local m = { } local 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") - tocharset = tocharset or "utf8" - local cd = assert(iconv.new(fromcharset, tocharset), "Bad charset") + local cd = assert(iconv.new(tocharset, fromcharset), "Bad charset") local fp = io.open(fname, mode) if not fp then return nil