Skip to content

specify the character encoding #20

@DanGrayson

Description

@DanGrayson

The validator complains if we don't specify a character encoding. A change like this might be good, for we can also tell emacs the character encoding to use:

diff --git a/html.ml b/html.ml
index 33b8cac..a12b5b5 100644
--- a/html.ml
+++ b/html.ml
@@ -23,7 +23,9 @@ let css = ref None
 
 let open_document ch ftitle =
   output_string ch
-    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n\n";
+    "<?xml version=\"1.0\" encoding=\"utf-8\"?> <!-- -*- coding: utf-8 -*- -->\n";
+  output_string ch
+    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\n";
   output_string ch "<html>\n\n<head>\n";
   output_string ch "<title>"; ftitle(); output_string ch "</title>\n";
   begin match !css with

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions