fix 'decoding Unicode is not supported' eårror

fix p2 bug http://manage.dimagi.com/default.asp?124545#703676