Convert NUL-containing NSString objects to Lisp strings correctly
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.
This commit is contained in:
parent
d172cd5985
commit
f063f79a49
1 changed files with 3 additions and 1 deletions
|
@ -3829,7 +3829,9 @@ handled fairly well by the NS libraries (displayed with distinct
|
||||||
/* Make a Lisp string from an NSString. */
|
/* Make a Lisp string from an NSString. */
|
||||||
- (Lisp_Object)lispString
|
- (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
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue