Fixing UTF-8 encoding for the foreign texts and characters.
authorFredrik Unger <fred@tree.se>
Wed, 16 May 2012 10:08:02 +0000 (12:08 +0200)
committerFredrik Unger <fred@tree.se>
Wed, 16 May 2012 10:08:02 +0000 (12:08 +0200)
xinclude/openinghours.py

index aab82207c906e3b88ed8d37d6dae667a61332068..641aec4c8eac4755d0b61910ce138e643c2fa5ea 100755 (executable)
@@ -22,10 +22,10 @@ loc_alias = {
 }
 
 title = {
-    'sv': 'Öppningstider',
-    'de': 'Öffnungszeiten',
-    'en': 'Opening hours',
-    'cs': 'Otevírací doba',
+    'sv': u'Öppningstider',
+    'de': u'Öffnungszeiten',
+    'en': u'Opening hours',
+    'cs': u'Otevírací doba',
 }
 day_header = {
     'sv': 'Dag',
@@ -69,7 +69,7 @@ for b in blocks:
     for d in days:
         times[int(d)] = t
 
-out = ''
+out = u''
 out += '''<table frame='all' xmlns="http://docbook.org/ns/docbook"
        xmlns:xlink="http://www.w3.org/1999/xlink">
   <title>'''+title[lang]+'''</title>
@@ -97,4 +97,4 @@ out += '''
 </table>
 '''
 
-sys.stdout.write(out.decode('utf-8'))
+sys.stdout.write(out.encode('utf-8'))