From c6b5a7e66327db43b34fde4efe259d987da70869 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 23 Sep 2003 02:50:53 +0000 Subject: [PATCH] * src/latin_utf8.py (latin_to_utf8): Convert to unicode only if needed. svn: r2159 --- gramps2/ChangeLog | 1 + gramps2/src/latin_utf8.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1d733e641..2a7a3e3a4 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -10,6 +10,7 @@ * doc/gramps-manual/C/custom.xml: Likewise. * doc/gramps-manual/C/Makefile.am: Ship new files. * doc/gramps-manual/C/Makefile.in: Likewise. + * src/latin_utf8.py (latin_to_utf8): Convert to unicode only if needed. 2003-09-21 Alex Roitman * src/plugins/book.glade: Minor improvements to the dialogs. diff --git a/gramps2/src/latin_utf8.py b/gramps2/src/latin_utf8.py index 9f52a61f5..e5a24fc6c 100644 --- a/gramps2/src/latin_utf8.py +++ b/gramps2/src/latin_utf8.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000 Donald N. Allingham +# Copyright (C) 2000-2003 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,6 +22,8 @@ def utf8_to_latin(s): return s.encode('iso-8859-1','replace') def latin_to_utf8(s): - return unicode(s,'iso-8859-1') - + if type(s) == type(u''): + return s + else: + return unicode(s,'iso-8859-1')