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

Alternate Encoding Handling for Addon Content #4596

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

ColdAnkles
Copy link
Contributor

@ColdAnkles ColdAnkles commented Dec 30, 2023

Identify the Bug or Feature request

fixes #4594

Description of the Change

Adds an ugly try/catch chain that attempts to determine the encoding of the byte array instead of assuming UTF8

Possible Drawbacks

Only handles ASCII, UTF-8, UTF-16, or Latin1 - and doesn't read file if can't determine encoding (null).

Documentation Notes

Uses Standard Java Charset Decoding, assuming different encodings until it matches or fails entirely.

Release Notes

Added Encoding Checks for Addon File Import


This change is Reviewable

@cwisniew
Copy link
Member

cwisniew commented Dec 30, 2023

There is no need to try it as ASCII first as UTF8 decoder should read an ASCII file fine. Also not sure about ISO_8859_1 as we don't want to go down the path of supporting detecting and reading every character set out there, UTF 8 and 16 are enough (well more than enough really :) )

@cwisniew cwisniew added the bug label Dec 30, 2023
@cwisniew cwisniew added this pull request to the merge queue Jan 2, 2024
Merged via the queue into RPTools:develop with commit 82c0b27 Jan 2, 2024
4 checks passed
@ColdAnkles ColdAnkles deleted the asset-constructor-string-fix branch January 8, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[Bug]: Asset Constructor Doesn't Handle UTF-16 Text Files When Loading Addon
2 participants