code: def test_cmd_line(self):
      arg = "h\xe9\u20ac".encode("utf-8")
      arg_utf8 = arg.decode("utf-8")
      arg_ascii = arg.decode("ascii", "surrogateescape")
      code = 'import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), ascii(sys.argv[1:])))'
  
      def check(utf8_opt, expected, **kw):
          out = self.get_output("-X", utf8_opt, "-c", code, arg, **kw)
          args = out.partition(":")[2].rstrip()
          self.assertEqual(args, ascii(expected), out)
  
      check("utf8", [arg_utf8])
      for loc in POSIX_LOCALES:
          with self.subTest(LC_ALL=loc):
              check("utf8", [arg_utf8], LC_ALL=loc)
  
      if sys.platform == "darwin" or support.is_android or VXWORKS:
          c_arg = arg_utf8
      elif sys.platform.startswith("aix"):
          c_arg = arg.decode("iso-8859-1")
      else:
          c_arg = arg_ascii
      for loc in POSIX_LOCALES:
          with self.subTest(LC_ALL=loc):
              check("utf8=0", [c_arg], LC_ALL=loc)
  
imports: import locale
  import subprocess
  import sys
  import textwrap
  import unittest
  from test import support
  from test.support.script_helper import assert_python_ok, assert_python_failure
  from test.support import os_helper, MS_WINDOWS
label_desc: Use image node_id 14 for calling the UTF8ModeTests obj's underlying member method code with example usage: obj.test_cmd_line() without return types