fix!: Ensure YAML/JSON loading uses UTF-8 instead of default encoding. #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



What was the problem/requirement? (What/Why)
Cinema 4D submissions fail to run if filenames contain non-ASCII values. For example, a scene file named
TestSceneñ.c4dwould not render.openjd_fail: Error encountered while starting adaptor:
Cinema4D Encountered an Error: FileNotFoundError: The scene file 'C:\some_path\TestñSceneñ.c4d' does not exist
What was the solution? (How)
While loading the JSON/YAML files, the default
open()uses system's encoding standard which is not UTF-8.This causes issues in other DCCs when they try to read the data.
What is the impact of this change?
This is not a full fix but a partial fix. Even after adding this change we will have few issues with logging that also uses default encoding and not "utf-8". The fix for that issue is currently in progress.
How was this change tested?
While renders now work for characters like
They still fail for emoji and some mathematical operators. Cinema 4D's load document function returns None without details on why it fails.
Additionally, it also fails for the Latin character ñ while logging which is currently being investigated.
Yes
Was this change documented?
Yes.
Is this a breaking change?
I discussed this with @AWS-Samuel and considering the packages are public, we have to operate under the assumption that customers are using the packages in their own, potentially private integrations. So even if we handle the change gracefully in all our integrations its still a breaking change.
If so, then please describe the changes that users of this package must make to update their scripts, or Python applications.
Users of this package must update their dependent packages to ensure that they use "UTF-8" encoding as well.
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.