Note that there are some explanatory texts on larger screens.

plurals
  1. PONSString replacing characters causing issue with Korean or Czech
    primarykey
    data
    text
    <p>I have a small issue trying to understand how to correctly append <code>NSString</code> in the case of Korean or Czech language.</p> <p>The context: I provide a <code>UITextField</code> to the user to type in some information, I want to keep a log of what has been modified by the user in the textfield to save the string only if it changed. When doing this, I use the <code>UITextFieldDelegate</code> protocol</p> <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSString *resultingString = [textField.text stringByReplacingCharactersInRange:range withString:string]; [(NSMutableDictionary *)self.currentModifiedObject setObject:resultingString forKey: @"textfield" ]; return YES; } </code></pre> <p>All is working fine with most of the languages but I recently received reports for the Korean and Czech language that there are issues with combining letters, for example with accent. When looking to what I record in the dictionary, a letter with accent that was created by typing a letter and adding an accent right after is recorded as is by this method.</p> <p>For instance, in Czech: If you type on the keyboard "Fidelesˇ" as a sequence of letter the <code>UITextField</code> shows "Fideleš" the recorded string shows "Fideles\U02c7" which is equivalent to the keyboard sequence.</p> <p>I'm interested in knowing the right method to actually generate the "Fideleš" from the "Fideles\U02c7" keyboard input.</p> <p>Thanks for your help, I hope someone can help me out on this one. Kind regards, David</p> <p>I've tried to use:</p> <pre><code>- (NSString *)precomposedStringWithCanonicalMapping - (NSString *)precomposedStringWithCompatibilityMapping </code></pre> <p>But with no results, the resulting string stays the same.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload