code: def test_filesystemencoding(self):
      code = textwrap.dedent(
          """
              import sys
              print("{}/{}".format(sys.getfilesystemencoding(),
                                   sys.getfilesystemencodeerrors()))
          """
      )
  
      if MS_WINDOWS:
          expected = "utf-8/surrogatepass"
      else:
          expected = "utf-8/surrogateescape"
  
      out = self.get_output("-X", "utf8", "-c", code)
      self.assertEqual(out, expected)
  
      if MS_WINDOWS:
          # PYTHONLEGACYWINDOWSFSENCODING disables the UTF-8 mode
          # and has the priority over -X utf8 and PYTHONUTF8
          out = self.get_output(
              "-X",
              "utf8",
              "-c",
              code,
              PYTHONUTF8="strict",
              PYTHONLEGACYWINDOWSFSENCODING="1",
          )
          self.assertEqual(out, "mbcs/replace")
  
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 6 for calling the UTF8ModeTests obj's underlying member method code with example usage: obj.test_filesystemencoding() without return types