From 99d11f894c807b65eb4ac005c4e3cd6845e541d9 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 26 Jan 2009 22:05:08 -0500 Subject: Should be reading and writing in binary mode; core/file_io.lua --- core/file_io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/file_io.lua') diff --git a/core/file_io.lua b/core/file_io.lua index 86c2c6c0..ac6e0107 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -26,7 +26,7 @@ local function open_helper(filename) if filename == buffer.filename then view:goto_buffer(index) return end end local buffer = textadept.new_buffer() - local f, err = io.open(filename) + local f, err = io.open(filename, 'rb') if f then local text = f:read('*all') local chunk = #text > 65536 and text:sub(1, 65536) or text @@ -91,7 +91,7 @@ function save(buffer) if not buffer.filename then return save_as(buffer) end prepare = _m.textadept.editing.prepare_for_save if prepare then prepare() end - local f, err = io.open(buffer.filename, 'w') + local f, err = io.open(buffer.filename, 'wb') if f then local txt, _ = buffer:get_text(buffer.length) f:write(txt) -- cgit v1.2.3