[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Allows to fill the csv output with unicode data

From: David Decotigny
Subject: [Maposmatic-dev] [PATCH] Allows to fill the csv output with unicode data
Date: Sat, 12 Sep 2009 00:40:36 +0200

Up to now, the csv data was encoded into ascii. Now, it's encoded in
UTF-8, allowing to correctly store unicode street names. Also adds a
copyright notice.
 ocitysmap/ |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ocitysmap/ b/ocitysmap/
index ef1bc83..e32c56b 100644
--- a/ocitysmap/
+++ b/ocitysmap/
@@ -533,15 +533,16 @@ class OCitySMap:
                 l.warning('error while opening destination file %s: %s'
                           % (output_filename, ex))
+                copyright_notice = (u'© 2009 MapOSMatic/ocitysmap authors. '
+                                    u'Map data © 2009 '
+                                    u'and contributors 
                 if title is not None:
-                    writer.writerow(['#', title.encode('latin1',  'replace'),
-                                     'ISO-8859-1'])
+                    writer.writerow(['# (UTF-8)', title.encode('UTF-8'), 
-                    writer.writerow(['#', 'MapOSMatic', 'ISO-8859-1'])
+                    writer.writerow(['# (UTF-8)', '', copyright_notice])
                 for street in self.streets:
-                    s = [e.encode('latin1', 'replace') for e in street]
-                    writer.writerow(s)
+                    writer.writerow([e.encode('UTF-8') for e in street])
         if file_type in ('png', 'png24'):

reply via email to

[Prev in Thread] Current Thread [Next in Thread]