Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to load utf-8 scene file #58

Open
danilwhale opened this issue Sep 6, 2023 · 1 comment
Open

fails to load utf-8 scene file #58

danilwhale opened this issue Sep 6, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@danilwhale
Copy link

it just throws error that it cant load it
python by default tries to open file in windows-1252, but it fails
would be good if UnityDocument.load_yaml would use utf-8 encoding by default

@classmethod
    def load_yaml(cls, file_path):
        register = UnityScalarRegister()
        with open(file_path, newline='', encoding='utf8') as fp:
            data = [d for d in load_all(fp, register)]
            # use document line endings if no mixed lien endings found, else default to linux
            line_endings = UNIX_LINE_ENDINGS if isinstance(fp.newlines, tuple) else fp.newlines
        doc = UnityDocument(data, newline=line_endings, file_path=file_path, register=register)
        return doc
@sp-ricard-valverde sp-ricard-valverde added bug Something isn't working good first issue Good for newcomers labels Sep 12, 2023
@sp-ricard-valverde
Copy link
Collaborator

Thanks for the report !
Feel free to open a PR following the contributing guidelines otherwise I'll eventually fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants