Open nnhubbard opened 10 years ago
Hi Nic!
We don't do anything special with emoticons in CYRTextView. I ran a test with a vanilla UITextView and am seeing the same issue where the spade is converted into an emoticon when setting just the text or attributedText property. I'm not really sure how do solve this issue right now but will investigate this coming weekend.
If you find out anything please let me know :).
Illya
Hmm, I also had done a test with just a plain UITextView and I didn't see the issue. Can you post the code that produced it? One of the Apple devs would be interested in the dev forums.
See below:
UITextView *textView = [[UITextView alloc] initWithFrame:self.view.frame];
// Test #1
textView.text = @"Emoticon Test: ♣ \u2663"; // \u2663 is the unicode character for ♣, displays an emoticon
// Test #2
textView.attributedText = [[NSAttributedString alloc] initWithString:@"Emoticon Test 2: ♣ \u2663"]; // displays an emoticon
// Test #3
textView.attributedText = [[NSAttributedString alloc] initWithString:@"Emoticon Test 2: &clubs"]; // displays &clubs
[self.view addSubview:textView];
Well, I didn't have issues with unicode characters, just ♣ (and many others) showing an emoticon. So, not sure if this is a CYRTextView bug, or a TextKit/UIKit bug.
Perhaps "♣" should be escaped to avoid conversion to emoticon?
Do you mean escaping HTML entities?
Yeah, if "& clubs;" shows as an emoticon (haha, Github also shows it so), "& amp;clubs;" will show correctly.
Yeah, but you can't expect a user to do this.
Perhaps it would be best to have additional methods for setting and getting escaped text.
For some reason, when setting a text string that contains an HTML entity, it renders that as an emoticon. Such as using ♣ will show the clubs icon.
It really shouldn't do this, as a plain UITextView with an attributed string doesn't do this. So somewhere in CYRTextView is the issue I would assume.