Is quote-wrapping a problem for all RTL iOS apps?

It took us a while to realize this problem existed, but iOS apps, whether built by SAB or the YouVersion app, would sometimes wrap a line in a way that separated a left/right single/double quote mark from the text that it was supposed to be glued to. It seems to me that iOS assumes it can wrap a line before a left quote and after a right quote, which is how it should be with LTR text, but it’s backwards with RTL text, which opens quotes with right quotes and closes them with left quotes.

What I don’t know is if this problem occurs in RTL writing systems other than Thaana. The best way to check for it is to find a passage that has many left and right quote marks, and set the font size to very large, then look for mis-wrappings. Can anyone confirm or deny the existence of the problem with other RTL writing systems on iOS?

The solution that worked for us was to use a changes rule that inserted the WORD JOINER (WJ) U+2060 character between quote marks and the adjacent text.

For SAB, this required a pair of changes like this:

Find: ([\u201c\u2018]) Replace with: \u2060\1
Find: ([\u201d\u2019]) Replace with: \1\u2060

If this is indeed an issue with all RTL projects, it would be worth adding these rules to the Changes Gallery, with descriptions like “Glue left quotes to preceding text (for RTL text on iOS)” and “Glue right quotes to following text (for RTL text on iOS)” respectively.

For YouVersion, this required the following rules to be added to the DBLChanges.txt file in the Paratext project folder:

# Insert WJ to glue quote marks to adjacent text (needed for iOS)
'([\u201c\u2018])' > '\u2060\1'
'([\u201d\u2019])' > '\1\u2060'

I looked an Arabic-script project with which I’m familiar and saw that it has the same problem in the app on iOS., however puts each verse in a new paragraph so this greatly limits the scope of the issue (most quotations end with the verse, so there’s a line break after the quotation anyway.) The app also left-aligns the Arabic script so it’s pretty ugly.

It probably wouldn’t work to use WJ with Arabic script, since that would cause the letter shape to change. I wonder if appropriate use of LTR marks could fix the issue?