code: def test_set_encoding(self):
      # Note: this works-ish mostly in case when the standard db connection
      # we test with is utf8, otherwise the encoding chosen by PQescapeString
      # may give bad results.
      snowman = "\u2603"
      a = adapt(snowman)
      a.encoding = "utf8"
      self.assertEqual(a.encoding, "utf8")
      self.assertEqual(a.getquoted(), b"'\xe2\x98\x83'")
  
imports: from .None import testutils
  import unittest
  from .testutils import ConnectingTestCase, skip_if_crdb
  import psycopg2
  import psycopg2.extensions
  from psycopg2.extensions import adapt, quote_ident
label_desc: Use image node_id 3 for calling the TestStringAdapter obj's underlying member method code with example usage: obj.test_set_encoding() without return types