code: def test_string_with_utf8_bom(self):
      # see #18958
      bom_json = "[1,2,3]".encode("utf-8-sig").decode("utf-8")
      with self.assertRaises(self.JSONDecodeError) as cm:
          self.loads(bom_json)
      self.assertIn("BOM", str(cm.exception))
      with self.assertRaises(self.JSONDecodeError) as cm:
          self.json.load(StringIO(bom_json))
      self.assertIn("BOM", str(cm.exception))
      # make sure that the BOM is not detected in the middle of a string
      bom_in_str = '"{}"'.format("".encode("utf-8-sig").decode("utf-8"))
      self.assertEqual(self.loads(bom_in_str), "\ufeff")
      self.assertEqual(self.json.load(StringIO(bom_in_str)), "\ufeff")
  
imports: import decimal
  from io import StringIO
  from collections import OrderedDict
  from test.test_json import PyTest, CTest
  from test import support
label_desc: Use image node_id 11 for calling the TestDecode obj's underlying member method code with example usage: obj.test_string_with_utf8_bom() without return types