Skip to content

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.

3 participants