title: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
body: <p>when i run my code i get this error:</p>
  
  <pre><code>UserId = "{}".format(source[1]) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>def view_menu(type, source, parameters):
      ADMINFILE = 'static/users.txt'
      fp = open(ADMINFILE, 'r')
      users = ast.literal_eval(fp.read())
      if not parameters:
          if not source[1] in users:
              UserId = "{}".format(source[1])
              users.append(UserId)
              write_file(ADMINFILE,str(users))
              fp.close()
              reply(type, source, u"test")
          else:
              reply(type, source, u"test")
  
  register_command_handler(view_menu, 'test', ['info','muc','all'], 0, '')
  </code></pre>
  
  <p>Please how i can solve this problem.</p>
  
  <p>Thank you</p>