Support non ascii characters

Support non ascii characters and fix tests.