node-dir icon indicating copy to clipboard operation
node-dir copied to clipboard

Remove unnecessary special character

Open andre-meyer opened this issue 5 years ago • 1 comments

As I was working on a project, this error was thrown at me: image It only occured when I was using the production build, as the Javascript Bundler I used (webpack) came with a dev-server that for some reason did not throw this error.

Upon closer inspecting of the line that this "unexpected" token is found, I found the sourcecode of this project: image

After being extremely confused about this for a few days, I searched through all the code in my dependencies for that dreaded  character. I did not find it. So I searched for all the various bits of code I saw around this broken character, which led me to the function in this Pull Request. You see when you just use this function in a UTF-8 environment, it all works fine. You wouldn't even notice it. But I forgot the meta "charset" html tag on my project, as this was very early in development and this error had me stumped. This omitted tag made the character set default to ISO-8859-1 (which would've caused other problems too I'm sure) and turns this innocent "no-breaking space" into " Â", breaking any interpreter.

This proposed change removes this character and replaces it with a space, to save someone elses sanity.

Edit: Oh, of course. This project is abandoned. Oh well, maybe some unfortunate soul will find this PR and it may help them.

andre-meyer avatar Sep 02 '20 08:09 andre-meyer

@fshost Have mercy and bring salvation to this unfortunate soul

cjay42 avatar Sep 02 '20 08:09 cjay42