From c5d0f909eb7683bb5de71994e8dc886aec667670 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 10 Jan 2017 17:16:50 +0500 Subject: Fix mail template encoding --- src/org/traccar/notification/NotificationFormatter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java index 819c387d1..b68d53ee0 100644 --- a/src/org/traccar/notification/NotificationFormatter.java +++ b/src/org/traccar/notification/NotificationFormatter.java @@ -16,6 +16,7 @@ package org.traccar.notification; import java.io.StringWriter; +import java.nio.charset.StandardCharsets; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -49,10 +50,10 @@ public final class NotificationFormatter { Template template = null; try { - template = Context.getVelocityEngine().getTemplate(event.getType() + ".vm"); + template = Context.getVelocityEngine().getTemplate(event.getType() + ".vm", StandardCharsets.UTF_8.name()); } catch (ResourceNotFoundException error) { Log.warning(error); - template = Context.getVelocityEngine().getTemplate("unknown.vm"); + template = Context.getVelocityEngine().getTemplate("unknown.vm", StandardCharsets.UTF_8.name()); } StringWriter writer = new StringWriter(); -- cgit v1.2.3