Assuming I have a form element that should allow pretty much any reasonable string that names something (IE like the title of this question).
How do I validate that the string is reasonable, and not something weird or unsafe? (Assuming here that something like Unicode emoticons☺ are reasonable)
Checking for all the escape chars like newlines, form feeds etc, is of course a given. Things like length is harder though, since an English descriptive name is very hard with just 1 char, but trivial in Chinese.
There are ~31 Unicode classes, which ones are safe?
What would a complete regex or similar check look like in Javascript or C#?