Taking json from a website and getting some json results back with escaped characters.
What's the best design pattern for removing the characters we don't like?
Here are some we don't like from here:
- \b Backspace (ascii code 08)
- \f Form feed (ascii code 0C)
- \n New line
- \r Carriage return
- \t Tab
- \v Vertical tab
- \' Apostrophe or single quote
- \" Double quote
- \ Backslash character
But my question is, in general, should you do
- it before you save it?
- after you save it, convert it right away?
- or should you convert it right before you display/use it?