Page 1 of 1

This is the evilest thing I can imagine! [C version]

PostPosted: Wed Dec 10, 2014 6:42 pm
by RatkinHHK
First the question: If I have a special character, encoded in a different format, how can I add it in a source file among other 'normal' characters?

And now the plan, so the above question makes sense:
The greek '?' character, encoded with U+037E, looks exactly like the latin semicolon: ';' Therefore, if I can somehow add this character in a source, it will not compile, but will look normal.

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Wed Dec 10, 2014 7:06 pm
by ghost107
Edit:
As for encoding on the source depends on your editor, if you want to name variables with special encoding characters will not work, but you can simply add the character to the strings, and comments, without any problems.

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Wed Dec 10, 2014 7:08 pm
by RatkinHHK
I want to use the character while I write the source, not use it at runtime.

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Thu Dec 11, 2014 12:44 am
by pretentious
RatkinHHK wrote:The greek '?' character, encoded with U+037E, looks exactly like the latin semicolon: ';' Therefore, if I can somehow add this character in a source, it will not compile, but will look normal.

Saw this on the interwebs recently too. The compiler error is pretty straight forward eg unrecognised character ';' at etc
But anyway, try using a character map or something that's off the top of my head ꓒꓤꓱꓷ

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Thu Dec 11, 2014 6:04 pm
by cyberdrain
What's the point of this: why would you upload broken but easily fixed code? You might as well add some hard to debug bugs to it.

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Fri Dec 12, 2014 12:23 am
by RatkinHHK
I did not realise it is so easy to fix. I did not take the compiler messages into account. Therefore, it won't work. Case Closed...

Re: This is the evilest thing I can imagine! [C version]

PostPosted: Fri Dec 12, 2014 12:09 pm
by cyberdrain
Oh come on, there's more fun where this came from. You could try to remove quotes from a string and use that to create cryptic error-messages. Maybe you could create a pointer based on some kind of weird character and get that to show problems much later in the program? Or do some string manipulation with a string that includes broken characters? It's a good idea, but it needs more work :)