-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
goog.crypt.base64.{en,de}codeStringUtf8
The non-`Utf8` version has lossy behavior when passed strings with characters outside the Latin-1 range (i.e. charCode > 255). This cannot be fixed in-place because the correct behavior depends on whether the input string is intended as text or binary. If it's binary, then the correct behavior is to throw (and a future change will start throwing asynchronously, so that this case should start showing up in logs). If it's text, then it's appropriate to first encode non-ASCII characters (i.e. charCode > 127) with UTF-8, but note that this is wholly inappropriate for binary input, since it changes the encoding of bytes in the [128..255] range. RELNOTES[NEW]: Added `goog.crypt.base64.{en,de}codeStringUtf8` PiperOrigin-RevId: 469817557 Change-Id: I8accaa98859aa05ec337cd0aaa2f1e2f7d185fa8
- Loading branch information
Showing
2 changed files
with
96 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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