]> granicus.if.org Git - recode/commitdiff
html.c: add explanation to FIXME
authorReuben Thomas <rrt@sc3d.org>
Fri, 26 Jan 2018 21:02:31 +0000 (21:02 +0000)
committerReuben Thomas <rrt@sc3d.org>
Fri, 26 Jan 2018 21:13:09 +0000 (21:13 +0000)
Outputting a BOM into HTML is marked “experimental”. Since there are
situations in which a BOM should not be output, this seems right. Needs
further evaluation.

src/html.c

index 09b9d93ac3b706a475d752f769e45f28717642d5..d2a026d4e4d3857fb9da3c3a4a0a845894d11d21 100644 (file)
@@ -706,6 +706,12 @@ transform_html_ucs2 (RECODE_SUBTASK subtask)
   if (input_char != EOF)
     put_ucs2 (BYTE_ORDER_MARK, subtask);       /* FIXME: experimental */
 
+  /* According to RFC 2718 and the Unicode Standard, if you declare the
+     character encoding of your page using HTTP as either "UTF-16LE" or
+     "UTF-16BE" then you should not use a byte-order mark at the beginning
+     of the page. Only if the page is labelled in HTTP using IANA charset
+     name "UTF-16" is a byte-order mark appropriate.  */
+
   while (input_char != EOF)
 
     if (input_char == '&')