From 0e85fafea121b912e20e022e423b6b472a2e93be Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 9 Mar 2022 09:14:55 -0800 Subject: Fix FlexApi frame decoding --- src/main/java/org/traccar/protocol/FlexApiProtocol.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/FlexApiProtocol.java b/src/main/java/org/traccar/protocol/FlexApiProtocol.java index bc6a49907..7f4154f71 100644 --- a/src/main/java/org/traccar/protocol/FlexApiProtocol.java +++ b/src/main/java/org/traccar/protocol/FlexApiProtocol.java @@ -21,6 +21,8 @@ import org.traccar.BaseProtocol; import org.traccar.PipelineBuilder; import org.traccar.TrackerServer; +import java.nio.charset.StandardCharsets; + public class FlexApiProtocol extends BaseProtocol { public FlexApiProtocol() { @@ -28,7 +30,7 @@ public class FlexApiProtocol extends BaseProtocol { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LineBasedFrameDecoder(5120)); - pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringDecoder(StandardCharsets.US_ASCII)); pipeline.addLast(new FlexApiProtocolDecoder(FlexApiProtocol.this)); } }); -- cgit v1.2.3