From e7b15b8aa5e3a88709b7c83b0f852a4afe8332d2 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Tue, 29 Jan 2008 18:18:45 +0000 Subject: [PATCH] Encoding according to sys.getfilesystemencoding() in stead of hardcoded iso-8859-1 svn: r9958 --- src/plugins/ExportVCalendar.py | 4 +++- src/plugins/ExportVCard.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/ExportVCalendar.py b/src/plugins/ExportVCalendar.py index 635e17d60..75d91c48a 100644 --- a/src/plugins/ExportVCalendar.py +++ b/src/plugins/ExportVCalendar.py @@ -28,6 +28,7 @@ # #------------------------------------------------------------------------- import os +import sys from time import localtime from gettext import gettext as _ @@ -193,7 +194,8 @@ class CalendarWriter: self.flist[family_handle] = 1 def writeln(self, text): - self.g.write('%s\n' % (text.encode('iso-8859-1'))) + #self.g.write('%s\n' % (text.encode('iso-8859-1'))) + self.g.write('%s\n' % (text.encode(sys.getfilesystemencoding()))) def export_data(self, filename): diff --git a/src/plugins/ExportVCard.py b/src/plugins/ExportVCard.py index 70edc2b29..2e7a05d3c 100644 --- a/src/plugins/ExportVCard.py +++ b/src/plugins/ExportVCard.py @@ -28,6 +28,7 @@ # #------------------------------------------------------------------------- import os +import sys from gettext import gettext as _ #------------------------------------------------------------------------ @@ -171,7 +172,8 @@ class CardWriter: self.plist[p] = 1 def writeln(self, text): - self.g.write('%s\n' % (text.encode('iso-8859-1'))) + #self.g.write('%s\n' % (text.encode('iso-8859-1'))) + self.g.write('%s\n' % (text.encode(sys.getfilesystemencoding()))) def export_data(self, filename):