tags:

views:

404

answers:

2

I have a collection of NSString objects that contain arabic text. However, when I try to display any of them using a UILabel, the text shows left-to-right instead of right-to-left (NSLog shows the strings properly)

I am thinking about a work-around, applying a transform to the UILabel to make a y-axis symmetry, but how can I detect if a NSString contains a RTL string?

A: 

Have you tried setting your region to Arabic? I would have thought this type of thing would be handled automatically.

Andrew Grant
Thanks AndrewThe problem is that I can not force the users to change their region. And it should be automatically handled, as it is in OS X, but...
A: 

Try prepending the unicode character 0x200F to the beginning of each string. This character is an invisible marker character that indicates text directionality.

Eric