Skip to content

Commit bc89ce9

Browse files
committed
Fix: set UTF-8 encoding for the HTML
1 parent e34b874 commit bc89ce9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tray-util/src/main/scala/com/github/opengrabeso/loctio/HtmlPanel.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.github.opengrabeso.loctio
33
import java.awt.Desktop
44
import java.io.ByteArrayInputStream
55
import java.net.URL
6+
import java.nio.charset.Charset
67

78
import org.xhtmlrenderer.simple.XHTMLPanel
89
import org.xhtmlrenderer.swing.NaiveUserAgent
@@ -28,7 +29,7 @@ class HtmlPanel(baseUri: String) extends Panel {
2829

2930
def html: String = throw new UnsupportedOperationException("HTML document is write only")
3031
def html_=(text: String): Unit = {
31-
val is = new ByteArrayInputStream(text.getBytes)
32+
val is = new ByteArrayInputStream(text.getBytes(Charset.forName("UTF-8")))
3233
val url = baseUri
3334
peer.setDocument(is, url + "/")
3435
}

0 commit comments

Comments
 (0)