title: How do I blacklist characters on a utf-8 string?
body: <p>I have an HTML text input where users can write in a name for themselves. The name is just a user-friendly display name, it's not used to identify the user in the database or for anything on the back end.</p>
  
  <p>I want to allow utf-8 characters, so that people can input characters of their native langugage, whether it's Chinese or Swedish or whatever.</p>
  
  <p>However, I want to blacklist certain characters, like &lt;,>, [, ], ?, *, and so on, to stop any potential script kiddies trying to exploit the input to make an SQL injection or whatever.</p>
  
  <p>I thought this would be straightforward code that there would be lots of examples of on the web, but the answer, if it's out there, is buried among examples of how to use a whitelist to validate email addresses (only English alphanumeric characters, no Asian or other language specific characters), or, oddly enough, how to stop key presses for certain characters entirely.</p>
  
  <p>I don't want to stop key presses entirely, as I think that might confuse the user in my case. Instead I'll output an error saying they can't use character X if they input a blacklisted one.</p>
  
  <p>So, for a guy like me who sucks totally at regex, is there a straightforward way of blacklisting characters in Javascript?</p>
  
  <p>I would also go for a whitelist solution if it didn't inhibit the ability for users to put in the funky characters from whatever language they're using.</p>