The Movie Database Support

Hey,

Is it possible that the API response have a wrong encoding type?

r = RestClient.get "#{baseURL}/3/account/#{userId}/movie_watchlist?api_key=#{apiKey}&session_id=#{sessionId}", header
p r.body.encoding 

#Encoding:US-ASCII
/usr/local/lib/ruby/2.1/json/common.rb:155:in `encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)$

2 replies (on page 1 of 1)

Jump to last post

Hey l33tname,

I don't think so. Looks like something local in your env:

2.1.3 :001 > require 'rest-client'
 => true
2.1.3 :002 > r = RestClient.get "https://api.themoviedb.org/3/account/#{user_id}/watchlist/movies?api_key=#{api_key}&session_id=#{session_id}"
2.1.3 :003 > p r.body.encoding
 => #<Encoding:UTF-8>
2.1.3 :004 >

However, I have seen the odd invalid character get saved to a field. Since you can inspect your response, you can probably see where the deserialization is having an issue. With that in hand, I can see if there's something weird on that one field.

Ups your right for some weird reason my environment was set to ASCII. So changing that to utf-8 an everything works fine.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login