Commit 06d440fa authored by Dan Pascu's avatar Dan Pascu

Fixed unicode problem with certain locales

parent 5e83dcef
...@@ -5,6 +5,7 @@ from __future__ import division ...@@ -5,6 +5,7 @@ from __future__ import division
__all__ = ['ChatWindow'] __all__ = ['ChatWindow']
import locale
import os import os
import re import re
...@@ -239,11 +240,13 @@ class ChatContent(object): ...@@ -239,11 +240,13 @@ class ChatContent(object):
@property @property
def date(self): def date(self):
return self.timestamp.strftime('%d %b %Y') language, encoding = locale.getlocale(locale.LC_TIME)
return self.timestamp.strftime('%d %b %Y').decode(encoding or 'ascii')
@property @property
def time(self): def time(self):
return self.timestamp.strftime('%H:%M') language, encoding = locale.getlocale(locale.LC_TIME)
return self.timestamp.strftime('%H:%M').decode(encoding or 'ascii')
@property @property
def text_direction(self): def text_direction(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment