Skip to content

Fix broken admin library view if game library contains paths/titles with non-unicode characters#193

Merged
DecDuck merged 9 commits into
Drop-OSS:developfrom
FurbyOnSteroids:fix-non-unicode-titles-in-tasks
Aug 16, 2025
Merged

Fix broken admin library view if game library contains paths/titles with non-unicode characters#193
DecDuck merged 9 commits into
Drop-OSS:developfrom
FurbyOnSteroids:fix-non-unicode-titles-in-tasks

Conversation

@FurbyOnSteroids
Copy link
Copy Markdown
Contributor

@FurbyOnSteroids FurbyOnSteroids commented Aug 16, 2025

Fixes #192

Btoa does not support non-unicode characters (https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa#unicode_strings).
This replaces btoa with Buffers to convert utf8 to base64.

@FurbyOnSteroids FurbyOnSteroids changed the title Fix broken admin library view if game library contains paths with non-unicode characters Fix broken admin library view if game library contains paths/titles with non-unicode characters Aug 16, 2025
FurbyOnSteroids and others added 4 commits August 16, 2025 12:25
@DecDuck
Copy link
Copy Markdown
Member

DecDuck commented Aug 16, 2025

Honestly, if you're up for it, a hash (md5/sha256) would be a better option for this. We don't ever need to reverse this, and a hash would make sure we don't get ridiculously long task IDs.

@FurbyOnSteroids
Copy link
Copy Markdown
Contributor Author

FurbyOnSteroids commented Aug 16, 2025

Honestly, if you're up for it, a hash (md5/sha256) would be a better option for this. We don't ever need to reverse this, and a hash would make sure we don't get ridiculously long task IDs.

Thought about this as well, but this requires a third-party library and as I'm not very well versed in the whole js/ts ecosystem with yarn and all that, I felt this was easier. I can try, but that'll take a bit

EDIT: was easier than I thought

@DecDuck
Copy link
Copy Markdown
Member

DecDuck commented Aug 16, 2025

I'd prefer if we didn't use another package and instead relied on the built-in crypto module and it's createHash function.

@FurbyOnSteroids
Copy link
Copy Markdown
Contributor Author

I'd prefer if we didn't use another package and instead relied on the built-in crypto module and it's createHash function.

Sorry, was not aware of that package. Changed it

@DecDuck
Copy link
Copy Markdown
Member

DecDuck commented Aug 16, 2025

Allg. Implementation looks good, if the CI passes, I'll merge.

@DecDuck DecDuck merged commit 6baddc1 into Drop-OSS:develop Aug 16, 2025
2 checks passed
@DecDuck
Copy link
Copy Markdown
Member

DecDuck commented Aug 16, 2025

Thanks for the PR!

Huskydog9988 pushed a commit to Huskydog9988/drop that referenced this pull request Apr 16, 2026
* replace btoa with a Buffer implementation, as btoa does not support non-unicode characters.

* replace btoa with a Buffer implementation, as btoa does not support non-unicode characters.

* fix linting

* fix linting

* replace buffer implementation with a md5 hash. This also adds the ts-md5 library.

* Revert "replace buffer implementation with a md5 hash. This also adds the ts-md5 library."

This reverts commit f98b811.

* replace buffer implementation with md5 hash from node:crypto

* fix linting.. again

---------

Co-authored-by: FurbyOnSteroids <codeberg@your-moms-bellybutton.hair>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Non-Unicode game titles break admin library page

2 participants