diff --git a/bin/osv/fields.py b/bin/osv/fields.py index a1069f8e386..99b39ed9c65 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -156,7 +156,7 @@ class char(_column): # we need to convert the string to a unicode object to be able # to evaluate its length (and possibly truncate it) reliably if isinstance(symb, str): - u_symb = unicode(symb.replace('\xa0', '\xc2\xa0'), 'utf8') + u_symb = unicode(symb, 'utf8') elif isinstance(symb, unicode): u_symb = symb else: diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 25bd39a4c76..7e1a7ca08a8 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -546,8 +546,8 @@ def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name= 'translatable': 1, 'date_format' : str(locale.nl_langinfo(locale.D_FMT).replace('%y', '%Y')), 'time_format' : str(locale.nl_langinfo(locale.T_FMT)), - 'decimal_point' : str(locale.localeconv()['decimal_point']), - 'thousands_sep' : str(locale.localeconv()['thousands_sep']), + 'decimal_point' : str(locale.localeconv()['decimal_point']).replace('\xa0', '\xc2\xa0'), + 'thousands_sep' : str(locale.localeconv()['thousands_sep']).replace('\xa0', '\xc2\xa0'), } try: