~kissiel/checkbox/fix-unicode

Viewing all changes in revision 4112.

  • Committer: Maciej Kisielewski
  • Date: 2015-11-24 16:44:12 UTC
  • Revision ID: maciej.kisielewski@canonical.com-20151124164412-tonulfcqlybfhywn
plainbox:exporter: ignore non-printable characters on certain terminals

This patch makes exporters checks if their encoding matches the encoding of
the stream they're exporting to. When they don't match, data is encoded using
ascii set and a warning message is printed.

The patch also makes exporter ignore all characters that cannot be encoded
using output encoding.

Previously, when checkbox-cli was launched with a locale set to a 'simple'
encoding (e.g. ascii, ansi*, etc.) at the end of testing user would get an
UnicodeEncodeError. This was caused by the fact that plainbox internally uses
utf-8 and uses characters not available in the simpler character sets.

Fixes: https://bugs.launchpad.net/plainbox/+bug/1494601

Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1432770

Fixes: https://bugs.launchpad.net/checkbox/+bug/1515745

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: