For instance the high voltage sign is U+26A1, but the UTF-8 encoding as bytes is \xE2\x9A\xA1
So then just do:
NRF.setAdvertising({},{ name: "\xE2\x9A\xA1" });
Note: While it looks like you're only using 1 character, you are actually sending 3 or 4 bytes - you'll only be able to send a few unicode characters in the relatively small amount of space there is for an advertising name.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It's really simple... If you're feeling lucky, simply copy & paste the emoji and upload from the right-hand side of the IDE:
And this should work as long as your IDE is up to date.
If you're feeling more restrained, you just need the UTF-8 bytes for the emoji you're using - which you can get easily from:
https://apps.timwhitlock.info/emoji/tables/unicode
For instance the
high voltage sign
isU+26A1
, but the UTF-8 encoding as bytes is\xE2\x9A\xA1
So then just do:
Note: While it looks like you're only using 1 character, you are actually sending 3 or 4 bytes - you'll only be able to send a few unicode characters in the relatively small amount of space there is for an advertising name.
1 Attachment