Fixed UTF8 encoding bug.
Added tests for UTF8 behaviour.