tests: More utf-8 decoding tests + refactoring.