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

filter out carriage returns for readfile #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

filter out carriage returns for readfile #44

wants to merge 1 commit into from

Conversation

gbwey
Copy link

@gbwey gbwey commented Oct 4, 2013

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
Copy link
Owner

gregwebs commented Oct 4, 2013

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