diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-04 13:26:16 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-04 13:26:16 +1200 |
commit | 4b4d68a4e6ee3bad66e00bd9905c572ad9c7b91b (patch) | |
tree | 2b6d67fa7164d6b0cb41d3c5162556818b53cd1c /src/org/traccar/protocol/Mta6ProtocolDecoder.java | |
parent | 2d920ecec746615281802e068044a3122a0ae90b (diff) | |
download | trackermap-server-4b4d68a4e6ee3bad66e00bd9905c572ad9c7b91b.tar.gz trackermap-server-4b4d68a4e6ee3bad66e00bd9905c572ad9c7b91b.tar.bz2 trackermap-server-4b4d68a4e6ee3bad66e00bd9905c572ad9c7b91b.zip |
Explicitly use ASCII charset
Diffstat (limited to 'src/org/traccar/protocol/Mta6ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Mta6ProtocolDecoder.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index bc8d95551..aea6cbddc 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -15,11 +15,6 @@ */ package org.traccar.protocol; -import java.net.SocketAddress; -import java.nio.charset.Charset; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; @@ -36,6 +31,12 @@ import org.traccar.helper.Log; import org.traccar.model.Event; import org.traccar.model.Position; +import java.net.SocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + public class Mta6ProtocolDecoder extends BaseProtocolDecoder { private final boolean simple; @@ -55,7 +56,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { HttpResponse response = new DefaultHttpResponse( HttpVersion.HTTP_1_1, HttpResponseStatus.OK); - ChannelBuffer begin = ChannelBuffers.copiedBuffer("#ACK#", Charset.defaultCharset()); + ChannelBuffer begin = ChannelBuffers.copiedBuffer("#ACK#", StandardCharsets.US_ASCII); ChannelBuffer end = ChannelBuffers.directBuffer(3); end.writeByte(packetId); end.writeByte(packetCount); @@ -282,7 +283,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes("id=".length()); int index = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '&'); - String uniqueId = buf.toString(buf.readerIndex(), index - buf.readerIndex(), Charset.defaultCharset()); + String uniqueId = buf.toString(buf.readerIndex(), index - buf.readerIndex(), StandardCharsets.US_ASCII); if (!identify(uniqueId, channel, remoteAddress)) { return null; } |