views:

70

answers:

2

Are there any unassigned, invisible, characters in the ascii spectrum that I could safely use as newline markers? The idea is to build a Java wordprocessor to edit Markdown in a wysiwyg fashion (like SO) but in the frame displaying the parsed markdown (unlike SO).

+5  A: 

Every character in ASCII (0x00 - 0x7F) (http://en.wikipedia.org/wiki/ASCII) has been assigned a proper meaning. But why don't you simply use \n (0x0a) as newline?

KennyTM
I need newline for the normal reasons. If you look at parsed markdown script, you will see that everything gets parsed down to an unbroken line. I need some way of preserving the original line breaks in the parsed markdown script that is easy for the java interpreter to find (in marked down script). Does that make sense?
piggles
@Mechko: Can you use Unicode?
KennyTM
Probably. I just never have :-p There are unassigned chars in unicode?
piggles
@Mechko: You can use noncharacters (http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Noncharacters). But the users will see a question mark thing so you need to transform your output. But if you can transform your output it may be easier to use `\r` or `\0` or `<br/>` etc.
KennyTM
BTW there is also `\u2028` (line separator).
KennyTM
+1  A: 

There are no UNASSIGNED characters, but BEL, NUL, and several other special characters will be invisible to the user and may be safe to use for your purposes.

Test carefully though!

BobMcGee
A BEL may however wake up the user.
David Harris
@David: Many programs aren't actually going to trigger the sound if they encounter BEL in a document.
BobMcGee