Fix UnicodeDecodeError

If params contain non-ascii characters merging fails.