This cures the inability to paste text containing NUL from other
applications on macOS, introduced by mistake in
7e3c2b553f
(bug#64697).
* src/nsfns.m ([NSString lispString]): Use make_string instead of
build_string which relies on NUL-termination.
/* Make a Lisp string from an NSString. */
- (Lisp_Object)lispString
{
- return build_string ([self UTF8String]);
+ // make_string behaves predictably and correctly with UTF-8 input.
+ return make_string ([self UTF8String],
+ [self lengthOfBytesUsingEncoding: NSUTF8StringEncoding]);
}
@end