Added test for utf8 mode

and fixed bug for handling utf8.
Added test for utf8 mode
refactoring
Added test for summary
Added basic test.