[PR #422] [MERGED] fix: garbled characters caused by atob #607

Closed
opened 2026-04-08 16:53:38 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigoden/dufs/pull/422
Author: @52funny
Created: 7/22/2024
Status: Merged
Merged: 7/22/2024
Merged by: @sigoden

Base: mainHead: issue419


📝 Commits (2)

  • 1b8d8cb fix: garbled characters caused by atob
  • 7c0e5af style: rename function name

📊 Changes

1 file changed (+20 additions, -1 deletions)

View changed files

📝 assets/index.js (+20 -1)

📄 Description

Author your commit #421 solves some problems but creates some new ones. For example, when the folder is some non-ASCII form of string, it may cause garbled problems. The root cause is that the atob function only accept a few ASCII characters, resulting in errors parsing strings beyond the 0xff range.

index.js #L111

image

This commit fixes a problem with atob not parsing non-ASCII characters. The Uint32Array view is utilized to process 4 bytes at a time, potentially providing an additional performance boost when working with large amounts of data.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/422 **Author:** [@52funny](https://github.com/52funny) **Created:** 7/22/2024 **Status:** ✅ Merged **Merged:** 7/22/2024 **Merged by:** [@sigoden](https://github.com/sigoden) **Base:** `main` ← **Head:** `issue419` --- ### 📝 Commits (2) - [`1b8d8cb`](https://github.com/sigoden/dufs/commit/1b8d8cb60a0431e7442788533f4566dfb6582982) fix: garbled characters caused by atob - [`7c0e5af`](https://github.com/sigoden/dufs/commit/7c0e5afac229d21afda368f008236446190799c8) style: rename function name ### 📊 Changes **1 file changed** (+20 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `assets/index.js` (+20 -1) </details> ### 📄 Description > Author your commit #421 solves some problems but creates some new ones. For example, when the folder is some non-ASCII form of string, it may cause garbled problems. The root cause is that the `atob` function only accept a few ASCII characters, resulting in errors parsing strings beyond the `0xff` range. > > [index.js #L111](https://github.com/sigoden/dufs/blob/ca5c3d7c541f7aa89c42db312d12e634cdc41460/assets/index.js#L111) > > <img alt="image" width="884" src="https://private-user-images.githubusercontent.com/47419733/350852760-0f7d4776-186a-45fc-9df9-2b7840881510.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2Mjg4MTksIm5iZiI6MTcyMTYyODUxOSwicGF0aCI6Ii80NzQxOTczMy8zNTA4NTI3NjAtMGY3ZDQ3NzYtMTg2YS00NWZjLTlkZjktMmI3ODQwODgxNTEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIyVDA2MDgzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM4ZDEyOWNiNGE4MjhkODEwMzBlYTExZGM0ZWNlNjhmMmI2NzQ3ZDAzODMzYjVmM2FjNzBjZGZmMzEyODRkMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SfP-XMfxNWXG8D9URDzBL3o4uEAmj3rSSaP4ZDoC7Ro"> This commit fixes a problem with `atob` not parsing non-ASCII characters. The Uint32Array view is utilized to process 4 bytes at a time, potentially providing an additional performance boost when working with large amounts of data. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-04-08 16:53:38 +03:00
zhus closed this issue 2026-04-08 16:53:38 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#607