Fix unicode issue

http://manage.dimagi.com/default.asp?124462#703606
it looks like this introduced a bug: `TypeError: decoding Unicode is not supported`