Skip to content

read() does not support encoding #12

Description

@BettyJJ

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions