Skip to content

about CR and LF #22

@fitso-2120

Description

@fitso-2120

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions