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

read() does not support encoding #12

Open
BettyJJ opened this issue Jun 23, 2024 · 1 comment · May be fixed by #13
Open

read() does not support encoding #12

BettyJJ opened this issue Jun 23, 2024 · 1 comment · May be fixed by #13

Comments

@BettyJJ
Copy link

BettyJJ commented Jun 23, 2024

I have a csv file with characters like 'ø'. When I read the file with read(), the characters are not read correctly. Passing encoding='utf-8' to read() does not work. I have to use open() instead. open() works, but it's a bit inconvenient. I checked the source code, and it should be possible to add encoding support to read(): change with self.open(path, "rt") as f: to with self.open(path, "rt", encoding=encoding) as f:. But of course, it depends on how you want to handle this. I can open a PR if you want. @sfc-gh-jcarroll

@sfc-gh-jcarroll
Copy link
Contributor

Thank you! Yes it makes sense. Yes, would welcome a PR to add encoding= support as a kwarg to the read() method.

@BettyJJ BettyJJ linked a pull request Jun 28, 2024 that will close this issue
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 a pull request may close this issue.

2 participants