diff --git a/bin/osv/fields.py b/bin/osv/fields.py index a1069f8e386b04f2f700aa41b15bb7b660fb3237..99b39ed9c65d42d9181ec42e0cbedb265ca9038e 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 25bd39a4c76fa8cca86a1422255044c6765eba51..7e1a7ca08a8c2b0cbc3266556cca426612353e9a 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: