Skip to content

fix: Emojis in code/syntax#22

Merged
Ivansss merged 1 commit into
masterfrom
fix/noid/code-emoji-rendering
Apr 20, 2026
Merged

fix: Emojis in code/syntax#22
Ivansss merged 1 commit into
masterfrom
fix/noid/code-emoji-rendering

Conversation

@SystemKeeper

@SystemKeeper SystemKeeper commented Apr 17, 2026

Copy link
Copy Markdown

Swifts .count on String is not equal to Objective-Cs length on NSString.

The count of the characters returned by the count property isn’t always the same as the length property of an NSString that contains the same characters. The length of an NSString is based on the number of 16-bit code units within the string’s UTF-16 representation and not the number of Unicode extended grapheme clusters within the string.

(Ref https://docs.swift.org/swift-book/documentation/the-swift-programming-language/stringsandcharacters/)

Since we use it to build a NSRange, we need to ensure either to use NSStrings length property (unescapedString as NSString).length or use the Swift equivalent unescapedString.utf16.count.

@Ivansss
Ivansss merged commit 35ccd2f into master Apr 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants