December 13th, 2011

Online gift ordering + enthusiastic kids at the keyboard + Unicode, wait… Unicode?

I was completing an online gift order for my young nephew’s birthday, and I was in the middle of typing Happy birthday into the gift card message when an enthusiastic child reached for the keyboard and held down the “a” key as I typed the final “a” in “birthday”. I wanted to capture the spontaneous enthusiasm in the gift tag, but I had no idea what font or format rectangle was going to be used, so I couldn’t be sure where to put hyphens so that they will ensure line breaks at visually-pleasing locations. And if I didn’t insert hyphens at all, then the line would just run off the end of the gift tag and end up truncated. Unicode to the rescue! First, I fired up charmap and went to character U+00AD SOFT HYPHEN. I double-clicked the character in the grid, thereby copying it invisibly to the Characters to copy box. I then clicked the Copy button to copy the invisible soft hyphen to the clipboard. Then I switched back to my Web browser and pasted the soft hyphen into the long string of a’s every six or so characters, to provide a hyphenation point. Success!

Happy birthd­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­aaaaaa­y!

When the gift reached its destination, my brother said, “Nice job on the hyphens. How did you know where to put them?” I then let him in on the secret. And now I’m sharing it with you.

Anybody know whether Amazon supports the creative use of Unicode to create elaborate smiley faces?

Topics
Other

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.