code: def get_text_v3(address, stream, mapped=False):
      
  
      if address == 0:
          return ""
  
      if mapped:
          size, = UINT16_uf(stream, address + 2)
          text_bytes = stream[address + 4: address + size]
      else:
          stream.seek(address + 2)
          size = UINT16_u(stream.read(2))[0] - 4
          text_bytes = stream.read(size)
      try:
          text = text_bytes.strip(b" \r\t\n\0").decode("latin-1")
      except UnicodeDecodeError as err:
          try:
              from cchardet import detect
  
              encoding = detect(text_bytes)["encoding"]
              text = text_bytes.strip(b" \r\t\n\0").decode(encoding)
          except ImportError:
              logger.warning(
                  'Unicode exception occured and "cChardet" package is '
                  'not installed. Mdf version 3 expects "latin-1" '
                  "strings and this package may detect if a different"
                  " encoding was used"
              )
              raise err
  
      return text
docs: faster way to extract strings from mdf versions 2 and 3 TextBlock
  
      Parameters
      ----------
      address : int
          TextBlock address
      stream : handle
          file IO handle
  
      Returns
      -------
      text : str
          unicode string