aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorEdward Valley <ed.valley@yandex.com>2019-08-23 22:40:26 -0400
committerEdward Valley <ed.valley@yandex.com>2019-08-23 22:40:26 -0400
commitbfeffa848ff23d873c9d44b6b4f1202fe403dd83 (patch)
tree6c1e09256194fb2de4d25b8bb184f183010cb422 /src/main
parent4ebb2d0c5c03846999b083c7ee52720730279b90 (diff)
downloadtrackermap-server-bfeffa848ff23d873c9d44b6b4f1202fe403dd83.tar.gz
trackermap-server-bfeffa848ff23d873c9d44b6b4f1202fe403dd83.tar.bz2
trackermap-server-bfeffa848ff23d873c9d44b6b4f1202fe403dd83.zip
Allow to use UTF8 to also encode messages to Wialon devices
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/WialonProtocol.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/WialonProtocol.java b/src/main/java/org/traccar/protocol/WialonProtocol.java
index 3838791a7..2eac58a3e 100644
--- a/src/main/java/org/traccar/protocol/WialonProtocol.java
+++ b/src/main/java/org/traccar/protocol/WialonProtocol.java
@@ -38,11 +38,12 @@ public class WialonProtocol extends BaseProtocol {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
pipeline.addLast(new LineBasedFrameDecoder(4 * 1024));
- pipeline.addLast(new StringEncoder());
boolean utf8 = Context.getConfig().getBoolean(getName() + ".utf8");
if (utf8) {
+ pipeline.addLast(new StringEncoder(StandardCharsets.UTF_8));
pipeline.addLast(new StringDecoder(StandardCharsets.UTF_8));
} else {
+ pipeline.addLast(new StringEncoder());
pipeline.addLast(new StringDecoder());
}
pipeline.addLast(new WialonProtocolEncoder(WialonProtocol.this));