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

Fix for latin1 issue #2758

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Fix for latin1 issue #2758

merged 1 commit into from
Nov 22, 2024

Conversation

Hydrocharged
Copy link
Contributor

This potentially fixes:

There's a longer comment in the code itself, but the summary is that this is a character set conversion issue. Perhaps it's repertoires or something else, but hopefully this moves us closer to the logically correct behavior.

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, two comments would be (1) hypothetically if this wasn't the fix, is there a way to improve the error message so we would have more info next time? (2) is perf OK for the default encodings? strings are already expensive so it would be nice if encodings.StringToBytes(val) avoided doing extra work when unnecessary. If there are perf issues, maybe only do the conversion and recheck if it fails the first time?

@Hydrocharged Hydrocharged merged commit dd8defd into main Nov 22, 2024
9 checks passed
@Hydrocharged
Copy link
Contributor Author

I'll make a new PR to adjust the error message. We can definitely provide a better one. encodings.StringToBytes(val) is the more performant alternative to just []byte{val) since it's getting the internal slice using the unsafe package, so there would technically be a minor performance uplift from using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants