fixed unicode handling in case of errors; tests for unicode support