From 9b6cfd686a153ac90400ec98a334190fb46487e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Paulo=20Barraca?= Date: Sun, 15 Oct 2017 14:23:21 +0100 Subject: [PATCH] Implement proper HPlus Unicode encoding support and Fixes #781 --- .../gadgetbridge/service/devices/hplus/HPlusSupport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusSupport.java index 26c5f9b3d..ff0344982 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusSupport.java @@ -829,7 +829,9 @@ public class HPlusSupport extends AbstractBTLEDeviceSupport { LOG.error("Could not convert String to Bytes: " + e.getMessage()); } } - for (int j = 0; j < cs.length; j++) + + final int j0 = (unicode && i != 0) ? 2 : 0; + for (int j = j0; j < cs.length; j++) outBytes.add(cs[j]); }