Skip to content

Commit 39ddbdb

Browse files
committed
DiscoveryThread: decode incoming packets using latin-1
1 parent b0c3696 commit 39ddbdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/oly/netpowerctrl/DiscoveryThread.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package oly.netpowerctrl;
22

33
import java.io.IOException;
4+
import java.io.UnsupportedEncodingException;
45
import java.net.DatagramPacket;
56
import java.net.DatagramSocket;
67

@@ -36,7 +37,7 @@ public void run() {
3637
socket.setReuseAddress(true);
3738
while (keep_running) {
3839
socket.receive(p);
39-
parsePacket(new String(message, 0, p.getLength()), recv_port);
40+
parsePacket(new String(message, 0, p.getLength(), "latin-1"), recv_port);
4041
}
4142
socket.close();
4243
} catch (final IOException e) {

0 commit comments

Comments
 (0)