Adds option to replace default undefined character

When encoding a string that has unsupported characters, the unsupported characters are replaced with a default valid character.

This allows you to define that replacement character rather than just defaulting to "?"