mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 18:33:54 +00:00
according to Kai's statement, set SailMaster charset to cp1252
This commit is contained in:
1 parent
70f0d8ce35
commit
9ee8128701
5 files changed
+5
-3
No files matched your search
Regular → Executable
File mode changed.
Regular → Executable
File mode changed.
@@ -7,4 +7,5 @@ Bundle-Vendor: SAP
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: com.sap.sailing.domain,
|
||||
com.sap.sailing.udpconnector
|
||||
Export-Package: com.sap.sailing.domain.swisstimingadapter
|
||||
Export-Package: com.sap.sailing.domain.swisstimingadapter,
|
||||
com.sap.sailing.domain.swisstimingadapter.impl;x-friends:="com.sap.sailing.domain.swisstimingadapter.test"
|
||||
Regular → Executable
File mode changed.
Regular → Executable
+3
-2
@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class SailMasterTransceiver {
|
||||
private static final byte STX = 0x02;
|
||||
@@ -11,7 +12,7 @@ public class SailMasterTransceiver {
|
||||
|
||||
public void sendMessage(String message, OutputStream os) throws IOException {
|
||||
os.write(STX);
|
||||
os.write(message.getBytes()); // TODO clarify which character set / encoding to use
|
||||
os.write(message.getBytes(Charset.forName("cp1252")));
|
||||
os.write(ETX);
|
||||
}
|
||||
|
||||
@@ -38,7 +39,7 @@ public class SailMasterTransceiver {
|
||||
bos.write(read);
|
||||
read = is.read();
|
||||
}
|
||||
String message = new String(bos.toByteArray()); // TODO clarify character set / encoding with Kai
|
||||
String message = new String(bos.toByteArray(), Charset.forName("cp1252"));
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user