Skip to content

Commit f86870d

Browse files
committed
Bangle.js: Fix wrapString when wrapping a non-UTF8 string containing UTF8 characters (fix #2633)
1 parent 1ca8483 commit f86870d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
nRF5x: Ensure Bluetooth notifications work correctly when two separate connections use the same handle for their characteristics
22
nRF5x: Remove handlers from our handlers array when a device is disconnected
3+
Bangle.js: Fix wrapString when wrapping a non-UTF8 string containing UTF8 characters (fix #2633)
34

45
2v26 : nRF5x: ensure TIMER1_IRQHandler doesn't always wake idle loop up (fix #1900)
56
Puck.js: On v2.1 ensure Puck.mag behaves like other variants - just returning the last reading (avoids glitches when used with Puck.magOn)

libs/graphics/jswrap_graphics.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,10 +2526,10 @@ JsVar *jswrap_graphics_wrapString(JsVar *parent, JsVar *str, int maxWidth) {
25262526
width += w;
25272527
wordStartIdx = (int)jsvStringIteratorGetIndex(&wordIt);
25282528
#ifdef ESPR_UNICODE_SUPPORT
2529-
jsvAppendUTF8Character(currentLine, wordCh);
2530-
#else
2531-
jsvAppendCharacter(currentLine, wordCh);
2529+
if (jsvIsUTF8String(str)) jsvAppendUTF8Character(currentLine, wordCh);
2530+
else
25322531
#endif
2532+
jsvAppendCharacter(currentLine, wordCh);
25332533
} else
25342534
break;
25352535
}

0 commit comments

Comments
 (0)