Replace non-ASCII dashes with ASCII hyphens to fix loader parsing and display issues #3881
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses two critical bugs that occur only when installing the app via the development App Loader (they do not appear when uploading the script directly through the Web IDE):
Malformed regex / syntax error
Cause: The source uses the Unicode minus sign (U+2212) in the BT calibration menu, which the Espruino minifier mis-parses and embeds into crsclock.app.js as an unfinished regex.
Symptom:
Uncaught SyntaxError: Got UNFINISHED REGEX expected ']'
Location: crsclock.js ≈ lines 612–614.
Garbled on-device text
Cause: Use of the EN DASH (U+2013) in prompt strings for the sleep window and range selections.
Symptom: Dash characters render as â (mojibake) on Bangle.js.
Locations:
Sleep window label (lines 84–86)
Range prompts (lines 714 & 723)
All non-ASCII dashes have been normalised to the standard ASCII hyphen-minus (-) so that both the Espruino minifier and the Bangle.js firmware handle them correctly.
Changes:
crsclock.js
Replaced all occurrences of U+2013 (EN DASH) and U+2212 (MINUS SIGN) with -
Updated prompt strings and menu labels accordingly
crsclock.app.js (auto-generated; should now minify without errors)
Verification:
Uploaded via App Loader—BT calibration menu works, no syntax errors in console
Sleep-window settings now display 08:00–22:00 (with ASCII hyphen) correctly on the device
Uploaded via Web IDE—unchanged behaviour, as expected
References:
Sleep window string initially using EN DASH (lines 84–86)
Unicode minus sign in BT calibration menu (lines 612–614)
Range prompts using EN DASH (lines 714 & 723)