Incorrect hyphenation with German text when using NSParagraphStyle's hyphenationFactor

Originator:need.magic
Number:rdar://41217178 Date Originated:June 18 2018, 8:14 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:12.0
Classification:Usability/UI Reproducible:Always
 
Hyphenation Factor on NSParagraphStyle does not respect the language of the text.
It may work perfectly for text in English, but it is unusable for German – Line breaks are splitting words at positions which is just obviously wrong for Germans.

Steps to Reproduce:
Run the sample project on an iPhone X Simulator, to see the wrong hyphenations.

As reference the wrong hyphenations (as performed by the OS) are given below, as well as the correct german hyphenation.

wrong: hau-seigenen
correct: haus-ei-ge-nen

wrong: de-shalb
correct: des-halb

wrong: Dat-en
correct: Da-ten

wrong: Spe-icherung
correct: Spei-cher-ung


Expected Results:
Hyphenation and line breaks should respect the language of the text and be correct for the language the text is in. If the correct language can't be detected automaticallt, the option to set a locale on a paragraph would probably help.


Actual Results:
Hyphenation and line breaks are incorrect when using German text.


Configuration:
iPhone X Simulator, Locale en_us, iOS 11.4 SDK, Xcode 9
iPhone X Simulator, Locale en_us, iOS 12 Beta 1 SDK, Xcode 10 Beta 1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!