my language is not supported by iOS by default, so unicode is not an option so i am using a embedded true type font on a UITextView
it works for the most part, but my issue is like Arabic, and Hebrew my language is written from right to left. So i need to change the direction of the text (Not Text Alignment).
i did some searches, they all talk about NSLocale and stuff, but can it be changed in code? if i can change it to something like Arabic/Hebrew it would work i guess, but it should be done in code, because i dont want change the language of the phone.
so what really are my options for text input? any help would be appreciated.
Thanks.
just use the Unicode 202B character for RIGHT-TO-LEFT EMBEDDING.
Example:
uiTextView.text = [NSString stringWithFormat:@"\u202B%@",textString];
You can place a "right-to-left embedding" Unicode character at start of each line in the text view.
Name: RIGHT-TO-LEFT EMBEDDING Unicode : 202B UTF8 : E2 80 AB
Note that this character is invisible (No shapes).
The following piece of code replaces the end-of-line characters with a EOL+RTL_EMBEDDING string :
Hi I think by using UIWebView with html and css you can do the job
The Iphone can not display Hebrew and other right-to-left texts correctly. so i think there is no way of u can change direction of the text.
For me simply adding the \u202B into the string directly into the .strings file didn't do the trick (The final result would print out literally print out the "202B" portion). However adding the \u202B into the string after it returns from the call to localizedStringForKey does do the trick.
Thus my solution, I inserted the arbitrary string "RLE_SYMBOL" directly into the string in the .strings file, then after the call to localizedStringForKey I replace "RLE_SYMBOL" with "\u202B".
A bit indirect, not the greatest solution but a quick solution.
You question have really interested me. So in a matter of hour I've came up with solution. It is far from perfect, but you can use it and fix remaining bugs. This is a simple view controller with text view. You can add text typing it or you can set the value using
So here is the code:
ReverseTextVC.h
ReverseTextVC.m
Hope it helps you =)