Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[translation] Reimplement UTF-8 check
Because our CPython build doesn't have UnicodeDecodeError. Also Python 2 allows UTF-8-like bytes that represent code points in the surrogate range, which is not UTF-8.
- Loading branch information
Andy C
committed
Jan 12, 2024
1 parent
8c1192d
commit 2e69c64
Showing
4 changed files
with
40 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
def J8EncodeString(s: str, j8_fallback: int) -> str: ... | ||
|
||
def PartIsUtf8(s: str, start: int, end: int) -> bool: ... |
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