Frontend Masters Boost RSS Feed https://frontendmasters.com/blog Helping Your Journey to Senior Developer Wed, 19 Feb 2025 14:56:09 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 225069128 Hide a message in an emoji https://frontendmasters.com/blog/hide-a-message-in-an-emoji/ https://frontendmasters.com/blog/hide-a-message-in-an-emoji/#respond Wed, 19 Feb 2025 14:56:08 +0000 https://frontendmasters.com/blog/?p=5204 Pretty interesting trickery here, encoding a secret message in an emoji that you automatically get when you copy/paste it from Paul Butler.

Most unicode characters do not have variations associated with them. Since unicode is an evolving standard and aims to be future-compatible, variation selectors are supposed to be preserved during transformations, even if their meaning is not known by the code handling them. So the codepoint U+0067 (ā€œgā€) followed by U+FE01 (VS-2) renders as a lowercase ā€œgā€, exactly the same as U+0067 alone. But if you copy and paste it, the variation selector will tag along with it.

So you slap on a bunch of “variations” to a character that doesn’t support them (the secret message) and then pluck them off if you happen to know they are there. Sneaky sneaky.

]]>
https://frontendmasters.com/blog/hide-a-message-in-an-emoji/feed/ 0 5204
Find a Unicode Character via Quick Sketch https://frontendmasters.com/blog/find-a-unicode-character-via-quick-sketch/ https://frontendmasters.com/blog/find-a-unicode-character-via-quick-sketch/#respond Tue, 04 Feb 2025 17:54:35 +0000 https://frontendmasters.com/blog/?p=5108 There are 155,063 Unicode characters. A lot of that is stuff from other languages, but there is still a large amount of randomly useful characters like arrows and symbols and whatnot. There are so many that even if you find good lists, it’s hard to search and sort. I like Benjamin Milde’s idea, shapecatcher, that lets you draw what you want and tries to find it for you.

Need an arrow that points up and to the left, that also has a circle around it? I actually assumed there wasn’t one, but there totally is.

]]>
https://frontendmasters.com/blog/find-a-unicode-character-via-quick-sketch/feed/ 0 5108
Can’t seem to remove the formatting from a string of text? https://frontendmasters.com/blog/cant-seem-to-remove-the-formatting-from-a-string-of-text/ https://frontendmasters.com/blog/cant-seem-to-remove-the-formatting-from-a-string-of-text/#comments Fri, 06 Dec 2024 15:17:12 +0000 https://frontendmasters.com/blog/?p=4666 I had a fella email me a line of text almost just like this:

š‚ššš„š„šž šš„ššš§šœšØš¬, š‚šØš¬š­šš š‘š¢šœšš

He said he could not remove that formatting no matter what he did. It looks kinda bold, doesn’t it? And set into a serif font. You’d think you could select it in the text editor you’re in and remove that formatting. He said he tried copy/pasting it into places where no text formatting is even allowed, like in VS Code or the URL bar of a browser. Voodoo, he said.

Here’s the thing: that text isn’t formatted.

That first “C” you see above isn’t a regular uppercase character C, our typical friend U+0043 : LATIN CAPITAL LETTER C, it’s “š‚”, that is, U+1D402 : MATHEMATICAL BOLD CAPITAL C. It’s literally a different character in Unicode. There are… a lot of Unicode characters:

As of Unicode version 16.0, there are 155,063 characters with code points, covering 168 modern and historical scripts, as well as multiple symbol sets.

List of Unicode characters — Wikipedia

It could be written like š•®š–†š–‘š–‘š–Š š•­š–‘š–†š–“š–ˆš–”š–˜, š•®š–”š–˜š–™š–† š•½š–Žš–ˆš–† instead, or š—–š—®š—¹š—¹š—² š—•š—¹š—®š—»š—°š—¼š˜€, š—–š—¼š˜€š˜š—® š—„š—¶š—°š—®.

Should you do this to get super sweet effects in places you otherwise couldn’t? Probably not. The accessibility is rough. Listen to the audio output in this blog post. If you’re going to do it on the web where you have HTML control, do something like:

<!-- Don't do this! Leaving for posterity. -->
<span aria-label="Calle Blancos, Costa Rica">
  <span aria-hidden="true">š•®š–†š–‘š–‘š–Š š•­š–‘š–†š–“š–ˆš–”š–˜, š•®š–”š–˜š–™š–† š•½š–Žš–ˆš–†</span>
</span>

UPDATE: See Ben’s comment on why not to do the above. Instead, make a visually hidden version that a screen reader would still see, and an ARIA hidden one that will be seen visually. (Noting potential concerns about copy/paste that started this whole article.)

<span class="visually-hidden">Calle Blancos, Costa Rica</span>
<span aria-hidden="true">š•®š–†š–‘š–‘š–Š š•­š–‘š–†š–“š–ˆš–”š–˜, š•®š–”š–˜š–™š–† š•½š–Žš–ˆš–†</span>
]]>
https://frontendmasters.com/blog/cant-seem-to-remove-the-formatting-from-a-string-of-text/feed/ 3 4666