tests: Add test for package.json file non utf8 encoded
Some refactoring were also performed to ease the adding of new tests data