News for hackers. Stuff that matters.
Re:Zero-Width Characters: Invisibly fingerprinting text by userbinator on Monday January 01, 2018 @11:50AM (#16046756)
This reminds me of a time not too long ago when I was teaching programming courses; at least one of the students would somehow manage to get one of these or other weird characters into source code, resulting in much confusion. On the bright side, I take advantage of the opportunity and an impromptu lesson in data representation and character encoding soon follows.

It's also one of the things where a hex editor is extremely useful --- even if you're not working on low-level, seeing the bits directly can be a great confirmation of correctness.

Re:Zero-Width Characters: Invisibly fingerprinting text by niij on Monday January 01, 2018 @01:50PM (#16047372)
I had this happen to me once (and only once, I learned my lesson). Our professor gave us a PDF with the problem description and it had a bit of code in it we were to put into our final program. Well, when I copy and pasted it some of the spaces copied as non-ASCII space.
Re:Zero-Width Characters: Invisibly fingerprinting text by chuckdries on Monday January 01, 2018 @04:56PM (#16048269)
Oh god pasting code from a PDF, that brings me back.

Doesn't your editor handle that? I don't exactly remember but I kinda remember having a button to convert pasted characters to ascii (mostly used for those annoying stylized unicode quotes)

Re:Zero-Width Characters: Invisibly fingerprinting text by niij on Thursday January 04, 2018 @06:38PM (#16075136)
Apparently Atom didn't/doesn't have that feature, at least to automatically display when problematic characters are present. I believe I ended up taking a hex editor to my code to see what was wrong, since it was only a single loop that appeared to stop the compilation.
Re:Zero-Width Characters: Invisibly fingerprinting text by fjsolwmv on Monday January 01, 2018 @05:35PM (#16048416)
Same problem if you have the honor of copypasting "smart quotes" from .doc or .html
Re:Zero-Width Characters: Invisibly fingerprinting text by sbrm1 on Monday January 01, 2018 @10:50PM (#16049729)
Also keep an eye out for the Greek question mark, looks identical to a semicolon.