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

encoding #21

Closed
sgehrman opened this issue Feb 21, 2022 · 2 comments
Closed

encoding #21

sgehrman opened this issue Feb 21, 2022 · 2 comments

Comments

@sgehrman
Copy link

Trying to use deepl.com, can't find any answers online.

I translate to japanese and get some weird encoding back. Can't figure out how to fix, there is not documentation on this. your examples are useless.

Why is your api so weird? Why not a simple post with json? x-www-form-urlencoded? Is this 1998?

For such a simple api, it's incredibly difficult to use.

@sgehrman
Copy link
Author

I figured it out.

I'm using Dart.

I normally can get the post response with: response.body
but I had to use: utf8.decode(res.bodyBytes)

Not sure why this doesn't "just work"

@daniel-jones-deepl
Copy link
Member

daniel-jones-deepl commented May 5, 2022

Hi @sgehrman, I am sorry that I am so late responding to this issue. Thanks for reporting the problems.

We have it on our roadmap to also support JSON in requests to our API.

I looked into the Dart issue a little, it seems to be a known problem in the Dart http library. This library does not assume utf8 charset for application/json type responses, rather latin1 instead. This problem is triggered because our API responses have Content-Type application/json but lack the explicit ; charset=utf8. We'll add this in future to avoid this problem.

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