How to bidi-isolate in pango?

there are bugs like RTL file names cause LTR message text to be broken into disconnected pieces in dialog and toast messages (#4217) · Issues · GNOME / Files · GitLab when adding text of different directions, in html this bug would be solved by <bdi></bdi> or <span dir=auto>, but how would it in pango ?

in Pango.AttrType there seems to not be anything like DIRECTION

there was a post before, but it didnt answer the original question

Totally untested: when composing the "%s.%s" moved to wastebasket string (or however it looks), start the %s.%s part for the filename.extension with a First Strong Isolate (U+2068) character and end it with a Pop Directional Isolate (U+2069) character. This should make Pango isolate the span between the directional formatting characters.