Live data from Hacker News

Beware of the Unicode no-break space (0xC2 0xA0)

news.ycombinator.com

1–8 of 8 posts

Beware of the Unicode no-break space (0xC2 0xA0)

#1
Hi all!

Yesterday I saw a very strange behavior while working with some tags, I thought this was a bug!

Can you spot the difference? (https://jsfiddle.net/vbjtcf3d/)

the other ( https://jsfiddle.net/q9d08xp1/ )

Both looks exactly the same!, but only one is working....

It turn out that it was an unicode character issue, the spacing between the non working tag was using the unicode non-breaking space (0xC2 0xA0), when I replaced the spaces with the regular space character (0x20) everything worked again.

I think that I copied this tag from an email, I will be extra careful in the future for this kind of issues.

It took me a while to find out this, I hope this could help anyone, if your attributes are null and you are sure that they are present check you html with a hex editor.

Let me know your thoughts

Re: Beware of the Unicode no-break space (0xC2 0xA0)

#4

If you use Evernote, at some point in the last year or so they started rewriting their spaces an non breaking space characters. I get tripped up almost weekly by some command or code I pasted from my notes

Thread on the issue

https://discussion.evernote.com/forums/topic/129900-non-brea...

Re: Beware of the Unicode no-break space (0xC2 0xA0)

#6

If you use Evernote, at some point in the last year or so they started rewriting their spaces an non breaking space characters. I get tripped up almost weekly by some command or code I pasted from my notes

This is the main reason I stopped subscribing to Evernote. It messes up my notes and I can't even see how. I'd use another note taking tool, but most are worse. It would be nice to have something with just plaintext, even without formatting.