Alternative fix for #78 and #90

Alternative fix for #78 and #90 based on a double conversion, first to UTF-16 and then to UTF-8, according to (1).

1: http://stackoverflow.com/a/11376806