Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any character that is never used (in ASCII or Unicode)

Tags:

c++

I just need one character that I can set in character arrays indicating that a particular location or a series of locations are free and available for storing data.

I need this because I am making a simple memory pool and need to reset freed blocks and indicate them as free.

Any help would be appreciated.

like image 693
angryInsomniac Avatar asked Mar 17 '13 18:03

angryInsomniac


People also ask

Are there characters in Unicode that are not in ASCII?

Unicode defines (less than) 221 characters, which, similarly, map to numbers 0–221 (though not all numbers are currently assigned, and some are reserved). Unicode is a superset of ASCII, and the numbers 0–127 have the same meaning in ASCII as they have in Unicode.

Is there an invisible ASCII character?

There is actually a truly invisible character: U+FEFF . This character is called the Byte Order Mark and is related to the Unicode 8 system.

What are ASCII and non-ASCII characters?

Non-ASCII characters are those that are not encoded in ASCII, such as Unicode, EBCDIC, etc. ASCII is limited to 128 characters and was initially developed for the English language.


1 Answers

All ASCII code points are used for characters, but there are plenty of Unicode code points that are guaranteed to not be characters, for example U+FFFF.

I'm not sure of what you would do with this information, though. While the code point is not a valid character you can construct strings that include it. Those strings would not be legal in Unicode, but you seem to imply that you can store any data, not just Unicode text.

like image 144
Joni Avatar answered Oct 29 '22 00:10

Joni