fix unicode encoding bug

Fix for the unicode encoding bug.