added support for unicode strings with unicode characters or code points
output is always six.text_type, that is str for 2.x, unicode for 3.x