* src/latin_utf8.py (latin_to_utf8): Convert to unicode only if needed.

svn: r2159
This commit is contained in:
Alex Roitman 2003-09-23 02:50:53 +00:00
parent 0b133ed25d
commit ed8a0c3eec
2 changed files with 6 additions and 3 deletions

View File

@ -10,6 +10,7 @@
* doc/gramps-manual/C/custom.xml: Likewise. * doc/gramps-manual/C/custom.xml: Likewise.
* doc/gramps-manual/C/Makefile.am: Ship new files. * doc/gramps-manual/C/Makefile.am: Ship new files.
* doc/gramps-manual/C/Makefile.in: Likewise. * 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 <shura@alex.neuro.umn.edu> 2003-09-21 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/book.glade: Minor improvements to the dialogs. * src/plugins/book.glade: Minor improvements to the dialogs.

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # 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') return s.encode('iso-8859-1','replace')
def latin_to_utf8(s): 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')