Commit 517b9c89 authored by Vincent Pelletier's avatar Vincent Pelletier

Do not raise when encountering non-UTF-8 chars.

Instead, replace them with standard unicode "rempalcement char":
http://en.wikipedia.org/wiki/Replacement_character#Replacement_character
parent 81b349ea
...@@ -1732,7 +1732,7 @@ class ListBoxRenderer: ...@@ -1732,7 +1732,7 @@ class ListBoxRenderer:
processed_value = editable_field.render_view(value=original_value) processed_value = editable_field.render_view(value=original_value)
if not isinstance(processed_value, unicode): if not isinstance(processed_value, unicode):
processed_value = unicode(str(processed_value), self.getEncoding()) processed_value = unicode(str(processed_value), self.getEncoding(), 'replace')
value_list.append((original_value, processed_value)) value_list.append((original_value, processed_value))
...@@ -2323,7 +2323,7 @@ class ListBoxRendererLine: ...@@ -2323,7 +2323,7 @@ class ListBoxRendererLine:
if processed_value is None: if processed_value is None:
processed_value = u'' processed_value = u''
elif not isinstance(processed_value, unicode): elif not isinstance(processed_value, unicode):
processed_value = unicode(str(processed_value), renderer.getEncoding()) processed_value = unicode(str(processed_value), renderer.getEncoding(), 'replace')
value_list.append((original_value, processed_value)) value_list.append((original_value, processed_value))
......
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