Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about CR and LF #22

Open
fitso-2120 opened this issue Feb 20, 2023 · 1 comment
Open

about CR and LF #22

fitso-2120 opened this issue Feb 20, 2023 · 1 comment

Comments

@fitso-2120
Copy link

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?

@fitso-2120
Copy link
Author

The source 'amp' does not support Windows.
So I take it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant