-
Notifications
You must be signed in to change notification settings - Fork 10
about CR and LF #22
Copy link
Copy link
Open
Description
Sorry for the machine translation.
environment:
- Windows 11.
- Create sentences in notepad.
- Read into Buffer with 'from_file()'.
result:
Line breaks were not recognized correctly.
investigation:
The line feed code in Windows is "0x0d0x0a"
On Mac/Linux, the line feed code is "0x0a"
The 'read_to_string()' used inside 'from_file()' reads the newline code as it is.
'line_count()' counts correctly because it counts '\n'.
'move_toXXX' recognizes it as a one-line string.
I tried changing "\n" in 'move_to_last_line()' but it didn't work.
first aid:
It is supported by reading line by line and adding a line feed code.
Is it possible to read 'from_file()' and recognize it correctly even if the line feed code is different?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels