{"id":8903,"date":"2011-12-13T07:00:00","date_gmt":"2011-12-13T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/12\/13\/online-gift-ordering-enthusiastic-kids-at-the-keyboard-unicode-wait-unicode\/"},"modified":"2011-12-13T07:00:00","modified_gmt":"2011-12-13T07:00:00","slug":"online-gift-ordering-enthusiastic-kids-at-the-keyboard-unicode-wait-unicode","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20111213-00\/?p=8903","title":{"rendered":"Online gift ordering + enthusiastic kids at the keyboard + Unicode, wait&#8230; Unicode?"},"content":{"rendered":"<p>I was completing <a href=\"http:\/\/www.amazon.com\/dp\/B000062SP5\/?tag=tholneth-20\"> an online gift order<\/a> for my young nephew&#8217;s birthday, and I was in the middle of typing <i>Happy birthday<\/i> into the gift card message when an enthusiastic child reached for the keyboard and held down the &#8220;a&#8221; key as I typed the final &#8220;a&#8221; in &#8220;birthday&#8221;.\n 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&#8217;t be sure where to put hyphens so that they will ensure line breaks at visually-pleasing locations. And if I didn&#8217;t insert hyphens at all, then the line would just run off the end of the gift tag and end up truncated.\n Unicode to the rescue!\n First, I fired up <code>charmap<\/code> and went to character <a href=\"http:\/\/www.fileformat.info\/info\/unicode\/char\/ad\/index.htm\"> U+00AD SOFT HYPHEN<\/a>. I double-clicked the character in the grid, thereby copying it invisibly to the <i>Characters to copy<\/i> box. I then clicked the <i>Copy<\/i> 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&#8217;s every six or so characters, to provide a hyphenation point.\n Success!<\/p>\n<blockquote class=\"m\" style=\"width: 30%\"><p> Happy birthd&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;aaaaaa&shy;y! <\/p><\/blockquote>\n<p> When the gift reached its destination, my brother said, &#8220;Nice job on the hyphens. How did you know where to put them?&#8221;\n I then let him in on the secret. And now I&#8217;m sharing it with you.<\/p>\n<p> Anybody know whether Amazon supports the creative use of Unicode to create elaborate smiley faces? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was completing an online gift order for my young nephew&#8217;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 &#8220;a&#8221; key as I typed the final &#8220;a&#8221; in &#8220;birthday&#8221;. I wanted to capture the spontaneous [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-8903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>I was completing an online gift order for my young nephew&#8217;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 &#8220;a&#8221; key as I typed the final &#8220;a&#8221; in &#8220;birthday&#8221;. I wanted to capture the spontaneous [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=8903"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8903\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=8903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=8903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=8903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}