[FFmpeg-devel] [PATCH 1/3] lavu: add av_is_valid_utf8().

Nicolas George nicolas.george at normalesup.org
Sun Apr 7 10:36:19 CEST 2013


L'octidi 18 germinal, an CCXXI, Reimar Döffinger a écrit :
> I don't think this macro improves readability, quite the opposite.

I find they do, but I will not insist on it.

> Why should a normal byte-order-mark be accepted in UTF-8?
> It really has no place or purpose in it either.
> (though it might be hard to detect, since the code point is really just
> a special non-breaking space I think)

Exactly: U+FEFF is utterly useless, but it is a valid Unicode character,
while U+FFFE is guaranteed to never exist, precisely to detect endianness
errors in conversions.

Also, there are quite a lot of text file out there in UTF-8 with a BOM; I
believe some editors take it as a hint to open the file in UTF-8 rather than
a legacy 8-bits encoding.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130407/40ab7380/attachment.asc>


More information about the ffmpeg-devel mailing list