PDI-10242
What was done
1. Added encoding lookup in variables
2. added unit and integration tests verifying the fix and old behavior
3. refactored existing unit tests to minimize copypasting