{"id":10725,"date":"2014-05-18T20:00:26","date_gmt":"2014-05-19T00:00:26","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=10725"},"modified":"2025-06-21T16:42:24","modified_gmt":"2025-06-21T20:42:24","slug":"%e2%92%bd%e2%93%9e%e2%93%a6-%e2%93%a3%e2%93%9e-%e2%93%91%e2%93%94-%e2%93%90%e2%93%9d%e2%93%9d%e2%93%9e%e2%93%a8%e2%93%98%e2%93%9d%e2%93%96-%e2%93%a6%e2%93%98%e2%93%a3%e2%93%97-%e2%93%85%e2%93%94","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2014\/05\/18\/%e2%92%bd%e2%93%9e%e2%93%a6-%e2%93%a3%e2%93%9e-%e2%93%91%e2%93%94-%e2%93%90%e2%93%9d%e2%93%9d%e2%93%9e%e2%93%a8%e2%93%98%e2%93%9d%e2%93%96-%e2%93%a6%e2%93%98%e2%93%a3%e2%93%97-%e2%93%85%e2%93%94\/","title":{"rendered":"\u24bd\u24de\u24e6 \u24e3\u24de \u24d1\u24d4 \u24d0\u24dd\u24dd\u24de\u24e8\u24d8\u24dd\u24d6 \u24e6\u24d8\u24e3\u24d7 \u24c5\u24d4\u24e1\u24db \u24d0\u24dd\u24d3 \u24ca\u24dd\u24d8\u24d2\u24de\u24d3\u24d4"},"content":{"rendered":"\n<p>It&#8217;s been so long since I&#8217;ve programmed in Perl. Twelve years ago, it was my life, but what with the Raspberry Pi intervening, I hadn&#8217;t used it in a while. It&#8217;s been so long, in fact, that I wasn&#8217;t aware of the new language structures available since version 5.14. Perl&#8217;s Unicode support has got a lot more robust, and I&#8217;m sick of Python&#8217;s whining about codecs when processing anything other than ASCII anyway. So I thought I&#8217;d combine re-learning some modern Perl with some childish amusement.<\/p>\n\n\n\n<p>What I came up with was a routine to convert ASCII alphanumerics ([0-9A-Za-z]) to Unicode <a href=\"http:\/\/www.unicode.org\/charts\/nameslist\/c_2460.html\">Enclosed Alphanumerics<\/a> ([\u24ea-\u2468\u24b6-\u24cf\u24d0-\u24e9]) for advanced lulz purposes. \u24be \u24e3\u24d7\u24d8\u24dd\u24da \u24d8\u24e3 \u24e6\u24de\u24e1\u24da\u24e2 \u24e1\u24d0\u24e3\u24d7\u24d4\u24e1 \u24e6\u24d4\u24db\u24db:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: perl; title: ; notranslate\" title=\"\">\n#!\/usr\/bin\/perl\n# annoying.pl - \u24d1\u24d4 \u24d0\u24dd\u24dd\u24de\u24e8\u24d8\u24dd\u24d6 \u24e6\u24d8\u24e3\u24d7 \u24e4\u24dd\u24d8\u24d2\u24de\u24d3\u24d4\n# created by scruss on 2014-05-18\n \nuse v5.14;\n# fun UTF8 tricks from http:\/\/stackoverflow.com\/questions\/6162484\/\nuse strict;\nuse utf8;\nuse warnings;\nuse charnames qw( :full :short );\nsub annoyify;\n \ndie &quot;usage: $0 &quot;, annoyify(&#039;string to print like this&#039;), &quot;\\n&quot; if ( $#ARGV &lt; 0 );\nsay annoyify( join( &#039; &#039;, @ARGV ) );\nexit;\n \n# \ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\ud83d\udca9\n \nsub annoyify() {\n    # convert ascii to chars in circles\n    my $str = shift;\n    my @out;\n    foreach ( split( &#039;&#039;, $str ) ) {\n        my $c = ord($_);             # remember, can be &gt; 127 for UTF8\n        if ( $c == charnames::vianame(&quot;DIGIT ZERO&quot;) )\n    {\n            # \ud83d\udca9\ud83d\udca9\ud83d\udca9 sigh; this one&#039;s real special ... \ud83d\udca9\ud83d\udca9\ud83d\udca9\n            $c = charnames::vianame(&quot;CIRCLED DIGIT ZERO&quot;);\n        }\n        elsif ($c &gt;= charnames::vianame(&quot;DIGIT ONE&quot;)\n            &amp;&amp; $c &lt;= charnames::vianame(&quot;DIGIT NINE&quot;) )\n        {\n            # numerals, 1-9 only (grr)\n            $c =\n              charnames::vianame(&quot;CIRCLED DIGIT ONE&quot;) +\n              $c -\n              charnames::vianame(&quot;DIGIT ONE&quot;);\n        }\n        elsif ($c &gt;= charnames::vianame(&quot;LATIN CAPITAL LETTER A&quot;)\n            &amp;&amp; $c &lt;= charnames::vianame(&quot;LATIN CAPITAL LETTER Z&quot;) )\n        {\n            # upper case\n            $c =\n              charnames::vianame(&quot;CIRCLED LATIN CAPITAL LETTER A&quot;) +\n              $c -\n              charnames::vianame(&quot;LATIN CAPITAL LETTER A&quot;);\n        }\n        elsif ($c &gt;= charnames::vianame(&quot;LATIN SMALL LETTER A&quot;)\n            &amp;&amp; $c &lt;= charnames::vianame(&quot;LATIN SMALL LETTER Z&quot;) )\n        {\n            # lower case\n            $c =\n              charnames::vianame(&quot;CIRCLED LATIN SMALL LETTER A&quot;) +\n              $c -\n              charnames::vianame(&quot;LATIN SMALL LETTER A&quot;);\n        }\n        else {\n            # pass thru non-ascii chars\n        }\n        push @out, chr($c);\n    }\n    return join( &#039;&#039;, @out );\n}\n<\/pre><\/div>\n\n\n<p>Yes, I really did have to do that special case for \u24ea; \u24ea\u2026\u2468 are not contiguous like ASCII 0\u20269. \u24d1\u24de\u24de!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been so long since I&#8217;ve programmed in Perl. Twelve years ago, it was my life, but what with the Raspberry Pi intervening, I hadn&#8217;t used it in a while. It&#8217;s been so long, in fact, that I wasn&#8217;t aware of the new language structures available since version 5.14. Perl&#8217;s Unicode support has got a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[1747,187,638],"class_list":["post-10725","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-annoying","tag-perl","tag-unicode"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-2MZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/10725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=10725"}],"version-history":[{"count":5,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/10725\/revisions"}],"predecessor-version":[{"id":17870,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/10725\/revisions\/17870"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=10725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=10725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=10725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}