What about a popup warning about unsupported characters in the file to be opened, and offering to either remove them or abort editing?
AFAIK its just four code points:
RLO (U+202E): treat the following text as right-to-left LRI (U+2066): treat the following text as left-to-right, without affecting the surrounding text RLI (U+2067): treat the following text as right-to-left, without affecting the surrounding text PDI (U+2069): terminate the most recent LRI or RLI