make test case easier to analyze
properly handle ISO-8859-1
add TestClass and fix related bugs