From 0fa5e7f03614cbeb86eab44fa21b723a4b27a9c2 Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 16 Jun 2020 14:24:50 +0000 Subject: [PATCH] Encoding angepasst --- src/de/uhilger/wbx/web/AdocServlet.java | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/de/uhilger/wbx/web/AdocServlet.java b/src/de/uhilger/wbx/web/AdocServlet.java index 61ec3cc..7bb93b4 100644 --- a/src/de/uhilger/wbx/web/AdocServlet.java +++ b/src/de/uhilger/wbx/web/AdocServlet.java @@ -74,8 +74,8 @@ String fname = nameext.substring(0, nameext.lastIndexOf(DOT)); File htmlfile = new File(adocfile.getParentFile(), fname + DOT + HTML); File outfile = htmlfile; // Standardmaessig wird HTML zurueckgegeben - response.setContentType("text/html;charset=UTF-8"); - + response.setCharacterEncoding("UTF-8"); + /* nach HTML transformieren, wenn die Quelle sich geandert hat oder die HTML-Datei noch nicht existiert @@ -93,7 +93,6 @@ if(null != pdf && pdf.equalsIgnoreCase(Boolean.TRUE.toString())) { File pdffile = new File(adocfile.getParentFile(), fname + DOT + PDF); outfile = pdffile; // PDF soll zurueckgegeben werden - response.setContentType("application/pdf;charset=UTF-8"); if(!pdffile.exists() || adocfile.lastModified() > pdffile.lastModified()) { transform(absname, PDF); } @@ -126,21 +125,16 @@ * nach PDF transformiert werden soll */ private void transform(String fileName, String backend) { - Map<String, Object> attributes = attributes() - .sourceHighlighter("highlightjs") - .asMap(); + Map<String, Object> attributes = attributes().sourceHighlighter("highlightjs") + .asMap(); Map<String, Object> options; if(null != backend) { - options = options() - .inPlace(false) - .backend(backend) - .attributes(attributes) - .asMap(); + options = options().inPlace(false) + .backend(backend).attributes(attributes).asMap(); + } else { - options = options() - .inPlace(false) - .attributes(attributes) - .asMap(); + options = options().inPlace(false) + .attributes(attributes).asMap(); } Asciidoctor asciidoctor = create(); -- Gitblit v1.9.3