3 ms·
It should be noted that the problems of U+202E and such are not inherent to all Bidi_Control characters: Right-to-Left Marker, Left-to-Right Marker and Arabic L
by chrismorgan 5y ago
It should be noted that the problems of U+202E and such are not inherent to all Bidi_Control characters: Right-to-Left Marker, Left-to-Right Marker and Arabic Language Marker are all safe (and useful)—though UTR #36 suggests going far enough (e.g. “use only LTR or RTL, and if RTL, first and last characters must be strong”) that they wouldn’t be useful. It’s specific to the characters that override the default stuff, which means Embedding, Isolate and Override characters.
The Trojan Source paper has a decent treatment of the area too, seen in a different application: https://trojansource.codes/trojan-source.pdf https://trojansource.codes/trojan-source.pdf.
- phkahler 5y agoThe problem seems to be that Unicode has gone a bit too far. No need to have the ability to do this.
- dtech 5y agoThe need seems quite obvious when mixing LTR and RTL languages, e.g. embed an American company or English phrase in a RTL language text.
- phkahler 5y agoWhy does it need to overwrite or obscure existing characters?
- _nalply 5y agoThe Right-To-Left Override (U+202E) does not obscure nor overwrite existing characters. It is an instruction to switch the text direction to right-to-left like for Arabic and Hebrew. In the article it is shown how this can be misused to show executable files as a different file type: file[U+202e]fdp.exe shown as fileexe.pdf ~~~~~~~~^^^^^^^ | |--- read this right-to-left, i.e. exe.pdf |----------- this is the Unicode character Right-To-Left Override
- kazinator 5y agoIt certainly obscures and overwrites. When you replace "fdp.exe" by "exe.pdf", you're obscuring and overwriting the leading "f" by "e", then the "d" by "x" and so on.
- dtech 5y agoIt doesn't overwrite or obscure, it switches rendering direction. E.g. \u202E\u41\u42\u43 starts outputting from the right: \u41 from the right, then 42, then 43. That's CBA, altough in normal English you'd render that as ABC.