Skip to content

filter out carriage returns for readfile#44

Open
gbwey wants to merge 1 commit into
gregwebs:masterfrom
gbwey:master
Open

filter out carriage returns for readfile#44
gbwey wants to merge 1 commit into
gregwebs:masterfrom
gbwey:master

Conversation

@gbwey

@gbwey gbwey commented Oct 4, 2013

Copy link
Copy Markdown

This is related to this pull request
yesodweb/shakespeare#113 referrring to https://gist.github.com/gbwey/6833805

This change to readfile will filter out carriage returns as does Data.Text.IO.readFile.
Avoids the situation in windows where you read a file/then write it back and it is different.

Is there a reason why we don't just use Data.Text.IO.readFile?

Thanks,
Grant

@gregwebs

gregwebs commented Oct 4, 2013

Copy link
Copy Markdown
Owner

I agree that using readFile from Text is probably best.

One potential difference though is the current use of lenientDecode: we don't want programs to crash from reading a file with an invalid UTF character.

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

Successfully merging this pull request may close these issues.

2 participants