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

ensure proper writing of codeunits #55

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

ExpandingMan
Copy link
Contributor

@ExpandingMan ExpandingMan commented Nov 8, 2022

There is a really nasty fallback for writing codeunits in Base:

write(io::IO, s::CodeUnits) = write(io, s.s)

what this means for InlineString is that it is writing the canonical binary representation of the InlineString, not the code units that are correctly returned by codeunits. This leads to confusing disasters like this.

This is a good demonstration of why it's really bad not to have a formal AbstractString interface. We really ought to open an issue in Base but it might take some background research to open an intelligent and actionable issue.

@quinnj
Copy link
Member

quinnj commented Nov 9, 2022

Oof, that is indeed unfortunate. Sorry for the hassle and thanks for the fix here.

@quinnj quinnj merged commit 6cb0088 into JuliaStrings:main Nov 9, 2022
@ExpandingMan
Copy link
Contributor Author

Yeah no worries, that would have been incredibly hard to catch for sure. Again, it's really more of a Base problem in my opinion.

@ExpandingMan
Copy link
Contributor Author

This could use a tag when you get a chance.

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.

None yet

2 participants