This simple text:
Text("10'20\"")
when the localisation is a RightToLeft, like Arabic
on iMac show "20'10
on iOS show 10'20"
Which is the correct one?
Why the are different?
According to the Bidirectional Algorithm (http://www.unicode.org/reports/tr9/), for the text “10'20"”, when it is presented in a text element whose directionality is right-to-left or natural (with the UI Language set to Arabic/Hebrew), the two elements “10'” and “20"” will change visual positions compared to a left-to-right context, i.e. it will be what you say you’re seeing on iMac.
However, depending on what this text semantically conveys, the Bidirectional Algorithm can and should be overridden with markup with the use of characters like U+200E LEFT-TO-RIGHT MARK
, U+200F RIGHT-TO-LEFT MARK
and many others. You will notice that the outputs from many of the Formatter
APIs include this markup to ensure that data is presented correctly.
To answer the question of why you’re specifically seeing a difference, we’ll need more details. I would suggest creating a sample project (or 2 projects, one for each platform) and filing a bug report via feedbackassistant.apple.com and mentioning the FB# here.