From 818f892cb89e388e3d8f33cece8aff65b41a8a9a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 23 Feb 2012 16:47:08 -0500 Subject: [PATCH] Address encoding errors due to 1st UTF8 usage in options We have to tell Python that our strings are UTF-8, naturally. Signed-off-by: Dan Scott --- tools/ebooks/prep_ebook_records.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/ebooks/prep_ebook_records.py b/tools/ebooks/prep_ebook_records.py index 9c40d33117..54a39a0118 100644 --- a/tools/ebooks/prep_ebook_records.py +++ b/tools/ebooks/prep_ebook_records.py @@ -39,7 +39,7 @@ class Institution(): "ebrary_code": "boreal", \ "proxy": "http://ra.ocls.ca/ra/login.aspx?url=", \ "link_text": "Disponible en ligne", \ - "access_note": "Accès réservé aux utilisateurs avec un ID valide Collège Boréal ;" \ + "access_note": u"Accès réservé aux utilisateurs avec un ID valide Collège Boréal ;" \ } self.laurentian = { \ @@ -207,8 +207,9 @@ def check_options(options): clean_opts = dict() clean_opts['publisher'] = append_period(options['--publisher']) - clean_opts['consortium'] = options['--consortium'] - clean_opts['authorization'] = options['--authorization'] + clean_opts['consortium'] = options['--consortium'].decode('utf-8') + clean_opts['authorization'] = options['--authorization'].decode('utf-8') + if '--ebrary' in options: clean_opts['ebrary'] = True -- 2.11.0