I\'m not sure which one is better. I need to parse each character of an input string and get a replacing string for the character. For some objects all alphanumeric characte
The switch code does the same thing as the alternative, but it's much more readable which should be the main concern here.
I would however use an abstract factory to get one of a number of different encoding implementations for different types of input.