Skip to content

Conversation

@keith-oak
Copy link

Summary

  • Fixed issue where usernames containing Unicode characters (emojis, non-Latin text) would cause btoa() to throw an error
  • Applied UTF-8 encoding before base64 encoding to properly handle Unicode characters

Changes

  • Updated saveCookie() function in src/public/auth.html to use btoa(unescape(encodeURIComponent(data))) instead of btoa(data)
  • This ensures Unicode characters are properly encoded to UTF-8 before base64 encoding

Test plan

  • Tested with various Unicode inputs including emojis (😊), Chinese characters (用户), and Arabic text (مستخدم)
  • Verified ASCII characters still work correctly
  • All existing unit tests pass

Fixes #269

🤖 Generated with Claude Code

Fixes issue where usernames containing Unicode characters (emojis, non-Latin text)
would cause btoa() to throw an error. The fix encodes to UTF-8 before base64 encoding.

Fixes #269

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@keith-oak keith-oak closed this by deleting the head repository Aug 13, 2025
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.

Auth Emulator - Indicate valid Username characters when invalid character(s) submitted

1 participant