langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
changeset 26665 e813baa25bf2
parent 25874 83c19f00452c
child 26900 dccc7a72526d
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Sep 17 23:52:19 2014 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Sep 18 00:50:48 2014 -0700
@@ -397,20 +397,19 @@
         Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
         Content head = new HtmlTree(HtmlTag.HEAD);
         head.addContent(getGeneratedBy(!configuration.notimestamp));
-        if (configuration.charset.length() > 0) {
-            Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
-                    configuration.charset);
-            head.addContent(meta);
-        }
         head.addContent(getTitle());
+        Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
+                (configuration.charset.length() > 0) ?
+                        configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET);
+        head.addContent(meta);
         if (!configuration.notimestamp) {
             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            Content meta = HtmlTree.META("date", dateFormat.format(new Date()));
+            meta = HtmlTree.META("date", dateFormat.format(new Date()));
             head.addContent(meta);
         }
         if (metakeywords != null) {
             for (String metakeyword : metakeywords) {
-                Content meta = HtmlTree.META("keywords", metakeyword);
+                meta = HtmlTree.META("keywords", metakeyword);
                 head.addContent(meta);
             }
         }