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 strings are not supported #5

Open
shockpast opened this issue Mar 19, 2025 · 0 comments
Open

UTF-8 strings are not supported #5

shockpast opened this issue Mar 19, 2025 · 0 comments

Comments

@shockpast
Copy link

Using .readString() to read collection.db I stumbled upon on these funny characters: broken encoding, without touching osu-buffer source code, it can be fixed with this simple if-condition:

// coll is my internal constant from forEach loop and custom type structure.

if (/[\u00C2\u00C3\u00D0\u00D1]/gi.test(coll.name))
        coll.name = Buffer.from(coll.name, "latin1").toString("utf8")

It should be applied (code above) before writing a broken string into database, otherwise it will break encoding more and more.

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

1 participant