code: def test_locale_getpreferredencoding(self):
      code = "import locale; print(locale.getpreferredencoding(False), locale.getpreferredencoding(True))"
      out = self.get_output("-X", "utf8", "-c", code)
      self.assertEqual(out, "utf-8 utf-8")
  
      for loc in POSIX_LOCALES:
          with self.subTest(LC_ALL=loc):
              out = self.get_output(
                  "-X", "utf8", "-c", code, LC_ALL=loc
              )
              self.assertEqual(out, "utf-8 utf-8")
  
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 13 for calling the UTF8ModeTests obj's underlying member method code with example usage: obj.test_locale_getpreferredencoding() without return types