From bb1323dd610f6ae0425e256b4b41cb6442aa9e08 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 23 Nov 2022 20:33:06 +0000 Subject: [PATCH] Ensure we automatically convert unrenderable chars the title/description of calendar events --- .../service/devices/banglejs/BangleJSDeviceSupport.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java index ef24b2948..011850551 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java @@ -846,6 +846,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport { } public String renderUnicodeAsImage(String txt) { + // FIXME: it looks like we could implement this as customStringFilter now so it happens automatically if (txt==null) return null; // Simple conversions txt = txt.replaceAll("…", "..."); @@ -1158,9 +1159,9 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport { o.put("type", calendarEventSpec.type); //implement this too? (sunrise and set) o.put("timestamp", calendarEventSpec.timestamp); o.put("durationInSeconds", calendarEventSpec.durationInSeconds); - o.put("title", calendarEventSpec.title); - o.put("description", calendarEventSpec.description); - o.put("location", calendarEventSpec.location); + o.put("title", renderUnicodeAsImage(calendarEventSpec.title)); + o.put("description", renderUnicodeAsImage(calendarEventSpec.description)); + o.put("location", renderUnicodeAsImage(calendarEventSpec.location)); o.put("calName", calendarEventSpec.calName); o.put("color", calendarEventSpec.color); o.put("allDay", calendarEventSpec.allDay);