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

UTF-8 characters are being serialized incorrectly #125

Open
mauricioszabo opened this issue Dec 5, 2017 · 1 comment · May be fixed by #137
Open

UTF-8 characters are being serialized incorrectly #125

mauricioszabo opened this issue Dec 5, 2017 · 1 comment · May be fixed by #137

Comments

@mauricioszabo
Copy link

I'm using ExVCR to mock a REST API that renders JSON descriptions with UTF-8 charset. When serializing cassetes, ExVCR is saving descriptions with wrong charset, which makes my tests fail. If I don't use ExVCR, my test passes, but using it, I'm having errors such as:

     Assertion with == failed
     code:  assert Plans.get_all() == %{"plans" => [%{"name" => "Plan3", "description" => "Comprar cartões"}]}
     left:  %{"plans" => [%{"name" => "Plan3", "description" => "Comprar cartões"}]}
     right: %{"plans" => [%{"name" => "Plan3", "description" => "Comprar cartões"}]}

Opening my cassete file, I can see the text "Comprar cartões" being saved.

@mauricioszabo
Copy link
Author

In a simple debugging, I found out that :ibrowse is bringing just a list of bytes - not the UTF-8 string. Probably we can work from there, either assuming that a string is always UTF-8 or checking headers to find encoding and use Codepagex or something to coerce the list into the correct encoding, WDYT?

@edwardzhou edwardzhou linked a pull request Jun 1, 2018 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.

1 participant