Friday, April 29, 2016

You cannot put null bytes in clipboard text

Somebody was wondering whether the Windows clipboard can hold text that contains null characters (ASCII 0). The answer is no.

The clipboard is aware of the format of its contents; MSDN has a list of standard formats. The descriptions of all three formats that involve text each have this sentence:
A null character signals the end of the data.
There's no way to have null characters in the text because a null tells the string processing functions that they've reached the end of the string.

No comments:

Post a Comment