#31 correct invalid UTF-8 bytes test cases and add valid UTF-8 bytes cases for the introduced new bug after refactoring