There are two changes to be made here:

- First, checkbox/variable.py, the UnicodeVariable class now uses the
'ascii' encoder by default (decoder in this case I think), so if the
string to be converted to unicode contains non-ascii characters, the
call to unicode will throw an exception, which was the originally
observed problem. Fix is to explicitly specify the encoding to use while
reading the string. I used utf-8.

- Second, when loading strings into a GtkTextBuffer, it expects utf8
encoding, otherwise it "eats" characters and the string gets truncated.
So we check to see if the passed text is a unicode instance and, if so,
it gets explicitly re-encoded as utf8, thus keeping the TextBuffer
happy.

I'll link a branch with these fixes in a couple of minutes.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/833747

Title:
  Test descriptions with non-ascii characters cause tests to not be run,
  backend to crash

To manage notifications about this bug go to:
https://bugs.launchpad.net/checkbox/+bug/833747/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to