diff --git a/Tusker/Views/AccountDisplayAndUserNameLabel.swift b/Tusker/Views/AccountDisplayAndUserNameLabel.swift index 0e96350349..be09d32d69 100644 --- a/Tusker/Views/AccountDisplayAndUserNameLabel.swift +++ b/Tusker/Views/AccountDisplayAndUserNameLabel.swift @@ -30,7 +30,9 @@ class AccountDisplayAndUserNameLabel: EmojiLabel { private func makeAttributedText(state: State) -> NSAttributedString { let s = NSMutableAttributedString() - s.append(NSAttributedString(string: state.displayName, attributes: [ + // U+2068 FIRST-STRONG ISOLATE and U+2069 POP DIRECTIONAL ISOLATE + // to prevent bidi text in the display name influencing the username + s.append(NSAttributedString(string: "\u{2068}\(state.displayName)\u{2069}", attributes: [ .font: UIFont(descriptor: baseFont.addingAttributes([ .traits: [ UIFontDescriptor.TraitKey.weight: UIFont.Weight.semibold.rawValue,