app: [macOS,iOS] don't use [NSString UTF8String]

UTF8String is lossy in the presence of nul (\x00) runes.

While here, don't CFRelease the input to nsstringToString; leave it
up to the caller.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-09 17:27:26 +01:00
parent b28307baeb
commit ef9e4071e7
5 changed files with 50 additions and 40 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ NSArray<UIKeyCommand *> *_keyCommands;
}
- (void)insertText:(NSString *)text {
onText((__bridge CFTypeRef)self, (char *)text.UTF8String);
onText((__bridge CFTypeRef)self, (__bridge CFTypeRef)text);
}
- (BOOL)canBecomeFirstResponder {