Add extension support for non-english names#1619
Merged
Merged
Conversation
victorhuangwq
approved these changes
Oct 30, 2022
victorhuangwq
left a comment
Contributor
There was a problem hiding this comment.
Works as expected.
LGTM
Contributor
|
works with 😀 now as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace use of
btoawith custom base 64 encoder obtained from MDN.(Note that it uses the deprecated
substrmethod, I've replaced it withsubstringwhich is equivalent since we start from index 0).Motivation and Context
Currently, it is generally not possible to create an extension for students with non-english names.
For reasons (see #931), we are base64 encoding student names and looking them up in a dictionary. However,
btoa"expects to be passed binary data, and will throw an exception if the given string contains any characters whose UTF-16 representation occupies more than one byte."On the other hand, Ruby's
Base64.strict_encode64handles it just fine. Hence this PR replaces the base64 encoding algorithm on the frontend.Closes #1466
How Has This Been Tested?
Types of changes
Checklist:
overcommit --install && overcommit --signto use pre-commit hook for linting