[Issue 12493] New: std.file.readText doesn't convert Windows newlines correctly
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 30 07:16:34 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12493
Summary: std.file.readText doesn't convert Windows newlines
correctly
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2014-03-30 07:16:32 PDT ---
If I create a text file named "text.txt" like this, that contains four lines,
and I save it with Windows newlines:
this
is
a
test
Then if I read and print the whole file like this:
void main() {
import std.stdio: writeln;
import std.file: readText;
auto t = readText("text.txt");
writeln(t);
}
Output:
this
is
a
test
Expected output:
this
is
a
test
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list