diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-01-21 17:36:26 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 18:54:35 +1030 |
commit | b77481ff100be4710419713d20faf3b8e1531ea2 (patch) | |
tree | 769c46b2e2dd97e12ab0ad52506c1044c074efae /lua | |
parent | 78e71e1f4e15a9f37d83fb71871c1c4f7c85a424 (diff) | |
download | lua-cjson-b77481ff100be4710419713d20faf3b8e1531ea2.tar.gz lua-cjson-b77481ff100be4710419713d20faf3b8e1531ea2.tar.bz2 lua-cjson-b77481ff100be4710419713d20faf3b8e1531ea2.zip |
Force binary file mode in util.lua
Force binary file mode in util.lua to fix the utf8.dat test under
Windows.
Diffstat (limited to 'lua')
-rw-r--r-- | lua/cjson/util.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
98 | file = io.stdin | 98 | file = io.stdin |
99 | else | 99 | else |
100 | local err | 100 | local err |
101 | file, err = io.open(filename) | 101 | file, err = io.open(filename, "rb") |
102 | if file == nil then | 102 | if file == nil then |
103 | error(("Unable to read '%s': %s"):format(filename, err)) | 103 | error(("Unable to read '%s': %s"):format(filename, err)) |
104 | end | 104 | end |
@@ -122,7 +122,7 @@ local function file_save(filename, data) | |||
122 | file = io.stdout | 122 | file = io.stdout |
123 | else | 123 | else |
124 | local err | 124 | local err |
125 | file, err = io.open(filename, "w") | 125 | file, err = io.open(filename, "wb") |
126 | if file == nil then | 126 | if file == nil then |
127 | error(("Unable to write '%s': %s"):format(filename, err)) | 127 | error(("Unable to write '%s': %s"):format(filename, err)) |
128 | end | 128 | end |