code: def test_xoption(self):
      code = "import sys; print(sys.flags.utf8_mode)"
  
      out = self.get_output("-X", "utf8", "-c", code)
      self.assertEqual(out, "1")
  
      # undocumented but accepted syntax: -X utf8=1
      out = self.get_output("-X", "utf8=1", "-c", code)
      self.assertEqual(out, "1")
  
      out = self.get_output("-X", "utf8=0", "-c", code)
      self.assertEqual(out, "0")
  
      if MS_WINDOWS:
          # PYTHONLEGACYWINDOWSFSENCODING disables the UTF-8 Mode
          # and has the priority over -X utf8
          out = self.get_output(
              "-X",
              "utf8",
              "-c",
              code,
              PYTHONLEGACYWINDOWSFSENCODING="1",
          )
          self.assertEqual(out, "0")
  
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 4 for calling the UTF8ModeTests obj's underlying member method code with example usage: obj.test_xoption() without return types