[haiku-commits] Re: haiku: hrev48017 - src/data/mime_db/text

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Oct 2014 12:39:39 +0200

Am 14.10.2014 11:22, schrieb Adrien Destugues:
\\000 is unescaped once by the rdef parser to \000. It is then escaped
a second time by the MIME sniffing rule parser to a null character.

But three zeros? :-)

The first character has no suffix, and the last one has no suffix. This
allows the rule to match UTF16 no matter which endianness is used (both
"<\0?\0x\0m\0l\0" (big endian) and "\0<\0?\0x\0m\0l" (little endian) are
recognized). It also uses the [0:15] to skip the byte order mark, if any.

That's quite smart, thanks for the explanation!

Bye,
   Axel.

Other related posts: