From: Dan Scott Date: Thu, 23 Feb 2012 21:47:08 +0000 (-0500) Subject: Address encoding errors due to 1st UTF8 usage in options X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=818f892cb89e388e3d8f33cece8aff65b41a8a9a;p=contrib%2FConifer.git 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 --- 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