3535# https://golangexample.com/go-linter-which-checks-for-dangerous-unicode-character-sequences/
3636# We use '\u' because it doesn't require a map lookup and is therefore faster
3737BIDI_UNICODE = [
38- "\u202A " , # \N{LEFT-TO-RIGHT EMBEDDING}
39- "\u202B " , # \N{RIGHT-TO-LEFT EMBEDDING}
40- "\u202C " , # \N{POP DIRECTIONAL FORMATTING}
41- "\u202D " , # \N{LEFT-TO-RIGHT OVERRIDE}
42- "\u202E " , # \N{RIGHT-TO-LEFT OVERRIDE}
38+ "\u202a " , # \N{LEFT-TO-RIGHT EMBEDDING}
39+ "\u202b " , # \N{RIGHT-TO-LEFT EMBEDDING}
40+ "\u202c " , # \N{POP DIRECTIONAL FORMATTING}
41+ "\u202d " , # \N{LEFT-TO-RIGHT OVERRIDE}
42+ "\u202e " , # \N{RIGHT-TO-LEFT OVERRIDE}
4343 "\u2066 " , # \N{LEFT-TO-RIGHT ISOLATE}
4444 "\u2067 " , # \N{RIGHT-TO-LEFT ISOLATE}
4545 "\u2068 " , # \N{FIRST STRONG ISOLATE}
4646 "\u2069 " , # \N{POP DIRECTIONAL ISOLATE}
4747 # The following was part of PEP 672:
4848 # https://www.python.org/dev/peps/pep-0672/
4949 # so the list above might not be complete
50- "\u200F " , # \n{RIGHT-TO-LEFT MARK}
50+ "\u200f " , # \n{RIGHT-TO-LEFT MARK}
5151 # We don't use
5252 # "\u200E" # \n{LEFT-TO-RIGHT MARK}
5353 # as this is the default for latin files and can't be used
@@ -100,7 +100,7 @@ def human_code(self) -> str:
100100 ),
101101 _BadChar (
102102 "sub" ,
103- "\x1A " ,
103+ "\x1a " ,
104104 "\\ x1A" ,
105105 "E2512" ,
106106 (
@@ -110,7 +110,7 @@ def human_code(self) -> str:
110110 ),
111111 _BadChar (
112112 "esc" ,
113- "\x1B " ,
113+ "\x1b " ,
114114 "\\ x1B" ,
115115 "E2513" ,
116116 (
@@ -129,7 +129,7 @@ def human_code(self) -> str:
129129 # Zero Width with Space. At the time of writing not accepted by Python.
130130 # But used in Trojan Source Examples, so still included and tested for.
131131 "zero-width-space" ,
132- "\u200B " , # \n{ZERO WIDTH SPACE}
132+ "\u200b " , # \n{ZERO WIDTH SPACE}
133133 "\\ u200B" ,
134134 "E2515" ,
135135 "Invisible space character could hide real code execution." ,
0 commit comments