[Issue 5378] File.byLine terminator string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 11 08:37:04 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=5378

Răzvan Ștefănescu <rumbu at rumbu.ro> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |rumbu at rumbu.ro
         Resolution|FIXED                       |---

--- Comment #8 from Răzvan Ștefănescu <rumbu at rumbu.ro> ---
Default behaviour is unexpected, at least on Windows where most files contain
lines ended in \r\n.

Use of lineSeparator enum for cross platform development does not guarantee
that the file you are processing contain only the lineSeparator terminator.

If I ask byLine, I expect to obtain a line not something else, not a line ended
with another line terminator. What if my file contains some lines ended in \r
and other line ended in \r\n?

Default behaviour must strip terminators and must consume all known line
separators, there is no point to discriminate between them:
- 0x0d
- 0x0d\0x0a
- 0x0a
- Unicode categories Zl, Zp.

--


More information about the Digitalmars-d-bugs mailing list