[#2157] Update Unicode handling in assertions.

Problem
-----------

The assertion text is inconsistent with unicode and utf-8 which produces errors when error message is displayed.

Changes
------------

Until we have a solid compat library, is hard to do something right here.
I just tried to update the code as better as possible.
Also did a small cleanup.
Code already released.

How to test
---------------

reviewers: @alibotean 

Check that changes are ok.


Thanks!