From 3e18b3b7fc04cef978548813964a57c4ba98783c Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 8 Nov 2006 08:09:42 +0000 Subject: [PATCH] don't ensure_utf8_string() when prefferedencoding is not 'UTF-8'. fixes #2514 --- src/conversation_textview.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index f75e9f309..35c615026 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -709,9 +709,10 @@ class ConversationTextview: format += day_str + ' ' format += '%X' + after_str tim_format = time.strftime(format, tim) - # if tim_format comes as unicode because of day_str. - # we convert it to the encoding that we want (and that is utf-8) - tim_format = helpers.ensure_utf8_string(tim_format) + if locale.getpreferredencoding() == 'UTF-8': + # if tim_format comes as unicode because of day_str. + # we convert it to the encoding that we want (and that is utf-8) + tim_format = helpers.ensure_utf8_string(tim_format) buffer.insert_with_tags_by_name(end_iter, tim_format + ' ', *other_tags_for_time) elif current_print_time == 'sometimes' and kind != 'info':