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

String encoding broken on texts coming from TMDB #535

Closed
HendrikD opened this issue Jan 16, 2018 · 3 comments
Closed

String encoding broken on texts coming from TMDB #535

HendrikD opened this issue Jan 16, 2018 · 3 comments

Comments

@HendrikD
Copy link
Contributor

HendrikD commented Jan 16, 2018

Issue description

There are character encoding errors when pulling data from TMDB (See screenshot). This effects all movie and show titles, as well as tags and video descriptions.

The bug

Steps to Reproduce

  1. Run fresh cloned master
  2. browse localhost:8080
  3. log in
  4. fill first time form, setting tmdp api language to "de"
  5. Go to manage content tab
  6. Type "game of thrones" into Search Show from collection or TheMovieDb..
  7. Click "Add and open" button on the Game of Thrones cover
  8. Click "Fetch Episodes" button, enter 1 in popup, klick "ok" button
  9. Click "Edit" Button on Episode S01E02.
  10. There are encoding erros both in the episodes title and the description

Expected Behaviour

Streama uses correct utf-8 encoding,

Actual Behaviour

I tested the TMDB API at the Strings returned from there are fine so Streama messes them up somewhere,

Environment Information

  • Operating System: Windows 10
  • Streama version: 1.5.0 (Revision 5e1750d)

Solution

I debugged Streama and i think i found the problem.
I have no experience with groovy but i was able to find that URL(..).text, which is used all over the place in TheMovieDbService.groovy and TheMovieDbController.groovy, returns those Strings. The solution seems to be to use URL(...).getText("UTF-8") instead. I implemented the change and tested it. It seems to work so i will send you a pull request.

@Jeronimo95
Copy link
Contributor

Thanks for the PR! Looking at the code the fix makes sense, I'll test the PR tonight and merge if it's all good.

@albertbertus
Copy link

tested with Spanish language (es-ES) works perfect !
Environment Information
Operating System: Windows 10
Streama version: 1.5.0

Thanks for this work.

@Jeronimo95
Copy link
Contributor

PR merged

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

No branches or pull requests

3 participants