From 460f1ce92d258f35e7382eba88b11b7b7762f77d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 8 Feb 2011 12:50:57 +0530 Subject: [PATCH] unicode --- ox/web/imdb.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index b17b927..bf91b0a 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -315,15 +315,12 @@ def getMovieId(title, director='', year='', timeout=-1): >>> getMovieId(u"Histoire(s) du cinéma: Le contrôle de l'univers", 'Jean-Luc Godard') u'0179214' ''' - if isinstance(title, unicode): - title = title.encode('utf-8') params = {'s':'tt','q': title} if director: - if isinstance(director, unicode): - director = director.encode('utf-8') - params['q'] = '"%s" %s' % (title, director) + params['q'] = u'"%s" %s' % (title, director) if year: - params['q'] = '"%s (%s)" %s' % (title, year, director) + params['q'] = u'"%s (%s)" %s' % (title, year, director) + params['q'] = params['q'].encode('utf-8') params = urllib.urlencode(params) url = "http://akas.imdb.com/find?" + params #print url