I struggled with the fraught user-text output output area for web pages. The ultimate goal is for user input to be displayed and stored exactly as it was typed, without breaking anything.
For this purpose, I used the following test line:
"_ $% ^ & * () + = - £ {} [] / n / <> \ @ ~; |, # :! &``"'
?
It seems to work well (even Qaru or Twitter are not protected, hence reverse ticks). My question is, will this line capture most of the escaping issues, for example, going from a webpage through Ajax and to the database and vice versa?
Actually, how do I display this line in Stack without reverse ticks?
Is there a better one, for example. let's say one that will also highlight encoding problems?
source share