1

I discovered that a text file created with Notepad++ or Notepad prefixes the actual text with three bytes:

enter image description here

They are not visible in either of these editors but the hexdump above reveals them, they are also visible when reading in the file with a program (a Python script for instance).

What are they?

WoJ
  • 2,804
  • 7
  • 48
  • 73
  • http://superuser.com/a/221602/19943 – Mokubai Jun 23 '16 at 07:28
  • From http://superuser.com/a/294280/19943 :"On Windows, UTF-8 files often start with a "byte order mark" EF BB BF to distinguish them from ANSI files." – Mokubai Jun 23 '16 at 07:30
  • Simply searching this site for "EF BB BF" gives a lot of questions on the origin and various problems this BOM can cause: http://superuser.com/search?q=Ef+bb+bf – Mokubai Jun 23 '16 at 07:33
  • @Mokubai: you are right, I am coming from the Linux world and thought it was a specific Notepad/Notepad++ thing - it didn't occur to me that it would be encoding. I will flag the question as a duplicate. Thanks. – WoJ Jun 23 '16 at 07:34
  • @Mokubai: as for searching: I usually rely on the suggestions after having typed my question but nothing popped up this time. But essentially yes: an actual search before posting the question would have been better. – WoJ Jun 23 '16 at 07:36
  • No worries, didn't want to close as dupe as it could have been a detail I was missing and the questions I found didn't seem as specific as yours with a "what is this?". I also wasn't meaning to suggest you *should* have used the search first, just that it gave a few good links. Specifically how it can break the command prompt is an interesting one... the BOM is useful, but can be problematic. Glad you got an answer though. – Mokubai Jun 23 '16 at 07:41
  • @Mokubai: even if you weren't meaning that that should have searched - I should have done that :) I tend to rely too much on the auto-suggestions and I have a feeling that they are letting me down more and more. Anyway - thanks for the pointer, this is exactly what I was looking for. – WoJ Jun 23 '16 at 07:56
  • that's [UTF-8 BOM](https://en.wikipedia.org/wiki/Byte_order_mark) – phuclv Nov 22 '16 at 03:45

0 Answers0