Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/cjson/util.lua4
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)
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