From b77481ff100be4710419713d20faf3b8e1531ea2 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Sat, 21 Jan 2012 17:36:26 +1030 Subject: Force binary file mode in util.lua Force binary file mode in util.lua to fix the utf8.dat test under Windows. --- lua/cjson/util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/cjson/util.lua b/lua/cjson/util.lua index 79245b5..6916dad 100644 --- a/lua/cjson/util.lua +++ b/lua/cjson/util.lua @@ -98,7 +98,7 @@ local function file_load(filename) file = io.stdin else local err - file, err = io.open(filename) + file, err = io.open(filename, "rb") if file == nil then error(("Unable to read '%s': %s"):format(filename, err)) end @@ -122,7 +122,7 @@ local function file_save(filename, data) file = io.stdout else local err - file, err = io.open(filename, "w") + file, err = io.open(filename, "wb") if file == nil then error(("Unable to write '%s': %s"):format(filename, err)) end -- cgit v1.2.3-55-g6feb