summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2015-09-11 19:59:54 +0300
committerVaadin Code Review <review@vaadin.com>2015-09-15 06:11:37 +0000
commit7ae4649a072459fdf6b24ea44e35711a12665276 (patch)
treecf22f58f0111994cf96d1d5886385d6140c1faaa /server/src/com/vaadin/ui
parent9e99e3e793ab14c3623f810b53471dde3d9f9816 (diff)
downloadvaadin-framework-7ae4649a072459fdf6b24ea44e35711a12665276.tar.gz
vaadin-framework-7ae4649a072459fdf6b24ea44e35711a12665276.zip
Always use charset for String.getBytes() method (#18863).
Change-Id: I15ce5a7922aebffc1a05ac55663033f7e5134d0c
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r--server/src/com/vaadin/ui/declarative/Design.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/declarative/Design.java b/server/src/com/vaadin/ui/declarative/Design.java
index a3589de5e2..63a2638423 100644
--- a/server/src/com/vaadin/ui/declarative/Design.java
+++ b/server/src/com/vaadin/ui/declarative/Design.java
@@ -59,6 +59,8 @@ import com.vaadin.ui.declarative.DesignContext.ComponentCreationListener;
*/
public class Design implements Serializable {
+ private static final String UTF8 = "UTF-8";
+
/**
* Callback for creating instances of a given component class when reading
* designs. The default implementation, {@link DefaultComponentFactory} will
@@ -350,7 +352,7 @@ public class Design implements Serializable {
*/
private static Document parse(InputStream html) {
try {
- Document doc = Jsoup.parse(html, "UTF-8", "", Parser.htmlParser());
+ Document doc = Jsoup.parse(html, UTF8, "", Parser.htmlParser());
return doc;
} catch (IOException e) {
throw new DesignException("The html document cannot be parsed.");
@@ -769,7 +771,8 @@ public class Design implements Serializable {
doc.outputSettings().indentAmount(4);
doc.outputSettings().syntax(Syntax.html);
doc.outputSettings().prettyPrint(true);
- outputStream.write(doc.html().getBytes());
+ doc.outputSettings();
+ outputStream.write(doc.html().getBytes(UTF8));
}
}