diff options
-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 |