How can I keep an Arabic character or word on the left of a string of Latin text on iOS?

377 Views Asked by At

I'm working on a React Native app, testing only on the iOS Simulator for now.

I'm displaying currencies for western users but using the correct symbol for each currency always on the left as western users expect.

But for certain currencies the symbol is in Arabic letters and the Unicode bidi algorithm forces the text to render with the currency symbol on the right.

Comparison of a western currency symbol against a couple of Arabic script currency symbols: Euro, Afghani, Riyal

This would be perfect for Arabic users but I need to keep the symbol on the left for western users. I know I could cop out and convert all such symbols to Latin but I'd like to know if there's a proper way to do this.

I experimented with all the special Unicode bidi characters and no matter what I tried the string always rendered with the symbol on the right instead of the left.

Is this a known problem with bidirection text on iOS or did I not manage to get the right control characters?

0

There are 0 best solutions below