Add new utility function for encoding to libreaders

Dependency needed by EasyRPG/Player/pull/150