Streama: String encoding broken on texts coming from TMDB

Created on 16 Jan 2018  路  3Comments  路  Source: streamaserver/streama

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 5e1750d2ebfdfe2dfad8deb6dfebd4191822b924)

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.

Bug PR - Ready4Review

All 3 comments

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.

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

Thanks for this work.

PR merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willmtemple picture willmtemple  路  6Comments

CardealRusso picture CardealRusso  路  4Comments

mosquedaoscar picture mosquedaoscar  路  6Comments

Tricky12321 picture Tricky12321  路  7Comments

airsay picture airsay  路  4Comments