diff options
author | 2020-03-26 17:37:08 -0400 | |
---|---|---|
committer | 2020-03-26 17:37:08 -0400 | |
commit | 940732342827ebe0d3bb98740419f621f9c77391 (patch) | |
tree | 32a3a6ac703429ca036e73c5215bac4f87b0818f /core/file_io.lua | |
parent | 52b0ec63792b3023b4ab42e42d2ce1e1fcb813bc (diff) | |
download | textadept-940732342827ebe0d3bb98740419f621f9c77391.tar.gz textadept-940732342827ebe0d3bb98740419f621f9c77391.zip |
Switched to 1-based indices for buffer positions, lines, and countable entities.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index b6fe441a..aa5aedc6 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -126,7 +126,7 @@ function io.open_file(filenames, encodings) buffer.encoding, text = encodings[i], text:iconv('UTF-8', encodings[i]) else -- Try to detect character encoding and convert to UTF-8. - local has_zeroes = text:sub(1, 65536):find('\0') + local has_zeroes = text:sub(1, 65535):find('\0') for _, encoding in ipairs(io.encodings) do if not has_zeroes or encoding:find('^UTF%-[13][62]') then local ok, conv = pcall(string.iconv, text, 'UTF-8', encoding) |