def content_string(self) -> str:
        """
        Get the content of this file as a string. Assumes UTF-8 encoding, may raise.

        May also raise if backed by a real file (`abs_src_path`) if it cannot be read.

        If used as a setter, it defines the content of the file, and `abs_src_path` becomes unset.
        """
        content = self._content
        if content is None:
            assert self.abs_src_path is not None
            with open(self.abs_src_path, encoding='utf-8-sig', errors='strict') as f:
                return f.read()
        if not isinstance(content, str):
            content = content.decode('utf-8-sig', errors='strict')
        return content

        Get the content of this file as a string. Assumes UTF-8 encoding, may raise.

        May also raise if backed by a real file (`abs_src_path`) if it cannot be read.

        If used as a setter, it defines the content of the file, and `abs_src_path` becomes unset.
        
mkdocs/structure/files.py