don't ensure_utf8_string() when prefferedencoding is not 'UTF-8'. fixes #2514

This commit is contained in:
Yann Leboulanger 2006-11-08 08:09:42 +00:00
parent a9624838ef
commit 3e18b3b7fc
1 changed files with 4 additions and 3 deletions

View File

@ -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':