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

UTF-8 is wrong #55

Open
tryashtar opened this issue Aug 6, 2023 · 1 comment
Open

UTF-8 is wrong #55

tryashtar opened this issue Aug 6, 2023 · 1 comment

Comments

@tryashtar
Copy link
Owner

Java decided that UTF-8 wasn't cool enough, and modified it: https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8

Of course, we need to support both

@RealRTTV
Copy link

Pretty sure it's only the null byte that matters here since string cloning takes O(n) time, but n inserts to an array can take O(n^2) time due to reallocation, I think for performance it's wisest to count the nulls and then append that many bytes to the pre-allocated buffer, and add a check to push another byte under a for loop for cloning (ofc under predicate of '\0'

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

No branches or pull requests

2 participants