# Fix \`write_to_clipboard\` on Windows when string contains embedded nulls \(\#64911\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/decbf641b18f1982b3475c037e7c5c554471574f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: decbf641b18f1982b3475c037e7c5c554471574f

Requested commit: decbf641b18f1982b3475c037e7c5c554471574f

Commit: decbf641b18f1982b3475c037e7c5c554471574f

Tree: 79a6a68c5f9fe23dd786f477799ca4f9a7ce51a4

Author: John Tur

Committer: GitHub

## Message

```
Fix `write_to_clipboard` on Windows when string contains embedded nulls (#64911)

The Windows clipboard stores a null-terminated string. If a string
contains an embedded null, copying it to the clipboard will truncate the
pasted text at that point. To work around this, replace embedded nulls
with spaces when copying text to the clipboard.

Fixes https://github.com/zed-industries/zed/issues/52330

Release Notes:

- N/A
- [GPUI] N/A
```

## Parents

- [263fb111771c0932c8b0ab1cdf8b1a501ad3f19e](https://git.cafe/gitcafe/zed/commit/263fb111771c0932c8b0ab1cdf8b1a501ad3f19e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/decbf641b18f1982b3475c037e7c5c554471574f?format=markdown)
