I checked and if you understood correctly, this function is used only in phpmailer.
Found the problem of replacing these characters with text. This happens if you use some kind of text editing, for example, you mark a part of the text in bold. Or you add a photo and align it in the center, in general, you use HTML markup. As soon as all text is formatted, the problem disappears.
But why is this happening?