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

No simple method for parsing strings #13

Open
lquenti opened this issue Sep 5, 2021 · 1 comment
Open

No simple method for parsing strings #13

lquenti opened this issue Sep 5, 2021 · 1 comment

Comments

@lquenti
Copy link

lquenti commented Sep 5, 2021

This is sometimes useful, especially if the bytes downloaded use some strange encoding, which needs to be handled manually before.

@NicolasLM
Copy link
Owner

Usually feeds containing non-utf8 data can be loaded via:

  • Their XML header that should describe their encoding: <?xml version="1.0" encoding="latin-1"?>. In this case it makes sense to pass raw bytes to the XML parsing library so that it can decode using the information embedded in the data.
  • Doing a atoma.parse_atom_bytes(latin_1_feed_bytes.decode('latin-1').encode()). Not very elegant but gets the job done.

Let me know if I'm missing something.

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

No branches or pull requests

2 participants