diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/hplus/HPlusConstants.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/hplus/HPlusConstants.java index 95395118..c13d9280 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/hplus/HPlusConstants.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/hplus/HPlusConstants.java @@ -130,60 +130,61 @@ public final class HPlusConstants { public static final String PREF_HPLUS_SIT_START_TIME = "hplus_sit_start_time"; public static final String PREF_HPLUS_SIT_END_TIME = "hplus_sit_end_time"; - public static final Map transliterateMap = new HashMap(){ + public static final Map transliterateMap = new HashMap(){ { //These are missing - put('ó', (byte) 111); - put('Ó', (byte) 79); - put('í', (byte) 105); - put('Í', (byte) 73); - put('ú', (byte) 117); - put('Ú', (byte) 85); + put('ó', new byte[]{(byte) 111}); + put('Ó', new byte[]{(byte) 79}); + put('í', new byte[]{(byte) 105}); + put('Í', new byte[]{(byte) 73}); + put('ú', new byte[]{(byte) 117}); + put('Ú', new byte[]{(byte) 85}); //These mostly belong to the extended ASCII table - put('Ç', (byte) 128); - put('ü', (byte) 129); - put('é', (byte) 130); - put('â', (byte) 131); - put('ä', (byte) 132); - put('à', (byte) 133); - put('ã', (byte) 134); - put('ç', (byte) 135); - put('ê', (byte) 136); - put('ë', (byte) 137); - put('Ï', (byte) 139); - put('è', (byte) 138); - put('Î', (byte) 140); - put('Ì', (byte) 141); - put('Ã', (byte) 142); - put('Ä', (byte) 143); - put('É', (byte) 144); - put('æ', (byte) 145); - put('Æ', (byte) 146); - put('ô', (byte) 147); - put('ö', (byte) 148); - put('ò', (byte) 149); - put('û', (byte) 150); - put('ù', (byte) 151); - put('ÿ', (byte) 152); - put('Ö', (byte) 153); - put('Ü', (byte) 154); - put('¢', (byte) 155); - put('£', (byte) 156); - put('¥', (byte) 157); - put('ƒ', (byte) 159); - put('á', (byte) 160); - put('ñ', (byte) 164); - put('Ñ', (byte) 165); - put('ª', (byte) 166); - put('º', (byte) 167); - put('¿', (byte) 168); - put('¬', (byte) 170); - put('½', (byte) 171); - put('¼', (byte) 172); - put('¡', (byte) 173); - put('«', (byte) 174); - put('»', (byte) 175); + put('Ç', new byte[]{(byte) 128}); + put('ü', new byte[]{(byte) 129}); + put('é', new byte[]{(byte) 130}); + put('â', new byte[]{(byte) 131}); + put('ä', new byte[]{(byte) 132}); + put('à', new byte[]{(byte) 133}); + put('ã', new byte[]{(byte) 134}); + put('ç', new byte[]{(byte) 135}); + put('ê', new byte[]{(byte) 136}); + put('ë', new byte[]{(byte) 137}); + put('Ï', new byte[]{(byte) 139}); + put('è', new byte[]{(byte) 138}); + put('Î', new byte[]{(byte) 140}); + put('Ì', new byte[]{(byte) 141}); + put('Ã', new byte[]{(byte) 142}); + put('Ä', new byte[]{(byte) 143}); + put('É', new byte[]{(byte) 144}); + put('æ', new byte[]{(byte) 145}); + put('Æ', new byte[]{(byte) 146}); + put('ô', new byte[]{(byte) 147}); + put('ö', new byte[]{(byte) 148}); + put('ò', new byte[]{(byte) 149}); + put('û', new byte[]{(byte) 150}); + put('ù', new byte[]{(byte) 151}); + put('ÿ', new byte[]{(byte) 152}); + put('Ö', new byte[]{(byte) 153}); + put('Ü', new byte[]{(byte) 154}); + put('¢', new byte[]{(byte) 155}); + put('£', new byte[]{(byte) 156}); + put('¥', new byte[]{(byte) 157}); + put('ƒ', new byte[]{(byte) 159}); + put('á', new byte[]{(byte) 160}); + put('ñ', new byte[]{(byte) 164}); + put('Ñ', new byte[]{(byte) 165}); + put('ª', new byte[]{(byte) 166}); + put('º', new byte[]{(byte) 167}); + put('¿', new byte[]{(byte) 168}); + put('¬', new byte[]{(byte) 170}); + put('½', new byte[]{(byte) 171}); + put('¼', new byte[]{(byte) 172}); + put('¡', new byte[]{(byte) 173}); + put('«', new byte[]{(byte) 174}); + put('»', new byte[]{(byte) 175}); + put('°', new byte[]{(byte) 0xa1, (byte) 0xe3}); } }; } 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 09842fad..d828325d 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 @@ -806,7 +806,7 @@ public class HPlusSupport extends AbstractBTLEDeviceSupport { byte[] cs; if (HPlusConstants.transliterateMap.containsKey(c)) { - cs = new byte[]{HPlusConstants.transliterateMap.get(c)}; + cs = HPlusConstants.transliterateMap.get(c); } else { try { if (HPlusCoordinator.getLanguage(this.gbDevice.getAddress()) == HPlusConstants.ARG_LANGUAGE_CN)