docs: def main():
      """
      Simple stdin/stdout interface.
      """
      if len(sys.argv) == 2 and sys.argv[1] in Locales:
          locale = sys.argv[1]
          convertfunc = convert
      elif len(sys.argv) == 3 and sys.argv[1] == '-w' and sys.argv[2] in Locales:
          locale = sys.argv[2]
          convertfunc = convert_for_mw
      else:
          thisfile = __file__ if __name__ == '__main__' else 'python -mzhconv'
          print("usage: %s [-w] {zh-cn|zh-tw|zh-hk|zh-sg|zh-hans|zh-hant|zh} < input > output" % thisfile)
          sys.exit(1)
  
      loaddict()
      ln = sys.stdin.readline()
      while ln:
          l = ln.rstrip('\r\n')
          if sys.version_info[0] < 3:
              l = unicode(l, 'utf-8')
          res = convertfunc(l, locale)
          if sys.version_info[0] < 3:
              print(res.encode('utf-8'))
          else:
              print(res)
          ln = sys.stdin.readline()