I would use a boolean[65536] which flags if the character has to be escaped.
I am quite confident that this is faster than the switch.
But only profiling can show if it is really faster.
I would use a boolean[65536] which flags if the character has to be escaped.
I am quite confident that this is faster than the switch.
But only profiling can show if it is really faster.