13
Awlex
5y

That one fucking time my text editor so damn high, that it choose to encode my file utf-8 BOM.
I was using Notepad++ because I thought it would just provide a good syntax highlighting, without stabbing me in the back

Seemingly nothing wrong with the code, but it took me, a friend and two teacher almost half an hour to figure out why the css simply wasn't work, even though it was clearly used and worker as intended when embeded in the file.

This was some years ago, so please don't judge me for my editor of choice at that time

Other than that, i simply suck at css and gladly use css frameworks 😅

Comments
  • 1
    I'm still using Notepad++, it rocks. Not least because it allows a bunch of UTF encodings.

    Since dealing with a UTF-8 BOM is trivial, I test my code with that instead of delivering brainless pieces of shit. :-) While I can't be bothered to support other UTF encodings when reading files, I equip my code at least with useful error messages.
  • 1
    @Fast-Nop Fair enough. But my browser obviously can't handle it when I set encoding to utf-8
  • 0
    Yeah. I got that issue with utf BOM in notepad++.
  • 0
    With BOM my php script wasn't working 😑
  • 0
    @oreru As magic start bytes to indicate that UTF-8 is being used.
  • 0
    @oreru there is no way to tell UTF-8 from a full-blown codepage that uses the full 8 bit range. A multibyte UTF-8 character may as well be several regular characters.

    That holds of course also true for the UTF-8 BOM, but it's not very probable. Plus that you already know this when you start to parse a file instead of finding it out later.

    The main disadvantage of the UTF-8 BOM is that it confuses old software even when the whole rest of the file is just in the ASCII range. That pretty much negates the downward compatibility of UTF-8, which is why it's not really widespread.

    But up to date software that expects ASCII anyway should be able to detect a UTF-8 BOM and just jump over it.
  • 0
    @oreru good point with the file concatenation! But that's just another argument against using the UTF-8 BOM. It doesn't justify modern programs barfing on it because jumping over that is really no big deal.

    And yes, UTF-8 by default is the best solution today, especially because it doesn't make a difference if it's ASCII content anyway.
  • 0
    Beyond Compare detects these encoding changes. I use it as difftool on the command line for bigger diffs. Helped me often to find similar mistakes.
Add Comment