mirror of
https://github.com/zoriya/vim.git
synced 2026-06-04 04:18:41 +00:00
Change readfile() to ignore byte order marks, unless in binary mode.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.3e. Last change: 2010 Aug 04
|
||||
*eval.txt* For Vim version 7.3e. Last change: 2010 Aug 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4524,6 +4524,7 @@ readfile({fname} [, {binary} [, {max}]])
|
||||
as an item. Lines broken at NL characters. Macintosh files
|
||||
separated with CR will result in a single long line (unless a
|
||||
NL appears somewhere).
|
||||
All NUL characters are replaced with a NL character.
|
||||
When {binary} is equal to "b" binary mode is used:
|
||||
- When the last line ends in a NL an extra empty list item is
|
||||
added.
|
||||
@@ -4531,7 +4532,8 @@ readfile({fname} [, {binary} [, {max}]])
|
||||
Otherwise:
|
||||
- CR characters that appear before a NL are removed.
|
||||
- Whether the last line ends in a NL or not does not matter.
|
||||
All NUL characters are replaced with a NL character.
|
||||
- When 'encoding' is Unicode any UTF-8 byte order mark is
|
||||
removed from the text.
|
||||
When {max} is given this specifies the maximum number of lines
|
||||
to be read. Useful if you only want to check the first ten
|
||||
lines of a file: >
|
||||
|
||||
Reference in New Issue
Block a user