def tonick(user_name):
  """Convert a Stack user name into an IRC nick name by stripping whitespace.
  Also roundtrips it through raw_unicode_escape to handle nicks in the user
  list (which use embedded \\uXXXX sequences for non-ASCII characters). For
  some reason nicks in MessagePosted events use the actual utf-8 characters,
  which are unharmed by this.
  """
  return (user_name
    .encode('raw_unicode_escape')
    .decode('raw_unicode_escape')
    .replace(' ', ''))