<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
        {mso-style-priority:99;
        mso-style-link:"Footnote Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
span.MsoFootnoteReference
        {mso-style-priority:99;
        vertical-align:super;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
        {mso-style-priority:1;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.FootnoteTextChar
        {mso-style-name:"Footnote Text Char";
        mso-style-priority:99;
        mso-style-link:"Footnote Text";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
/* Page Definitions */
@page
        {mso-endnote-separator:url("cid:header.htm\@01D2F079.0795E9E0") es;
        mso-endnote-continuation-separator:url("cid:header.htm\@01D2F079.0795E9E0") ecs;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'>Stuart makes a good point. I added a number of suggestions to the document as well.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'>tex<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> ua-discuss-bounces@icann.org [mailto:ua-discuss-bounces@icann.org] <b>On Behalf Of </b>Stuart Stuple via UA-discuss<br><b>Sent:</b> Wednesday, June 28, 2017 7:35 AM<br><b>To:</b> Don Hollander; ua-discuss@icann.org<br><b>Subject:</b> Re: [UA-discuss] DRAFT: UA103 - Programming Hacks<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-size:11.0pt'>There is somewhat “in passing” statement about sorting such that punycode and full representations are treated as equivalent. How is that expected to be done? It seems like a fair bit of additional code that would slow down a simple sort.<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></a></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt'>From:</span></b><span style='font-size:11.0pt'> <a href="mailto:ua-discuss-bounces@icann.org">ua-discuss-bounces@icann.org</a> [<a href="mailto:ua-discuss-bounces@icann.org">mailto:ua-discuss-bounces@icann.org</a>] <b>On Behalf Of </b>Don Hollander<br><b>Sent:</b> Tuesday, June 27, 2017 2:37 PM<br><b>To:</b> <a href="mailto:ua-discuss@icann.org">ua-discuss@icann.org</a><br><b>Subject:</b> [UA-discuss] DRAFT: UA103 - Programming Hacks<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><a href="https://docs.google.com/document/d/1i4OAeojY5dj3ZAG8sHcrpSdaG1vN_R011MOuza4djRY/edit?usp=sharing">https://docs.google.com/document/d/1i4OAeojY5dj3ZAG8sHcrpSdaG1vN_R011MOuza4djRY/edit?usp=sharing</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>As part of our efforts to raise awareness, we’re producing editorials/guest blogs that we’re getting published in various professional body newsletters and such.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Our third editorial is focusing on Programming Hacks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Editable copy is available at the link above.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Here’s the current draft.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Comments please, by the 10<sup>th</sup> of July.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Thanks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'>Don<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><u>Programming language hacks<o:p></o:p></u></b></p><p class=MsoNormal><b><u><span style='font-size:11.0pt'>UA103<o:p></o:p></span></u></b></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Computer programmers are nice people.&nbsp; They are intelligent.&nbsp; They are wise.&nbsp; (Their mothers would say they are good looking </span><span style='font-size:11.0pt;font-family:Wingdings'>J</span><span style='font-size:11.0pt'>).&nbsp; They know that if people have a chance to make a mistake, they will.&nbsp; So, the wise, intelligent (and good looking) computer programmers build their systems to help prevent mistakes at the source.&nbsp; Computer programmers are also very efficient (their siblings might say lazy) and will reuse code – either their own or someone else’s. For years computer programmers have been putting the same data validation of email addresses and domain names into their code to reduce the amount of Garbage In.&nbsp; And this now turns out to be a mistake.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>What’s happened is that while the validation code has been pretty static, email addresses and domain names have been changing quite radically.&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Since 2001, Top Level Domain Names (TLDs) have been longer than two or three characters.&nbsp; Since 2010 Top Level Domain names have been available in non-ASCII characters.&nbsp; And since 2013, the number of TLDs and their frequency of entry into the Root Zone has gone off the charts!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>And today we also have mailbox names (the label to the left of the ‘@’) that can also be in non-ASCII characters!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>So, it’s time for computer programmers to update their code to accommodate these new domain name options.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>So here are some tips and tricks for computer programmers to use when updating their code:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Input<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Data fields that accept domain names or email addresses should be able to accept ASCII <u>and</u> non-ASCII characters.&nbsp; UTF-8 is the key here.&nbsp; This will affect both programs that accept data from a keyboard or other data sources and the database where its stored.&nbsp;&nbsp; The good news is that most modern databases will have no problems with this.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Validation<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>The easiest way to deal with this is to only use syntactic validation against the specifications in the <a href="https://uasg.tech/wp-content/uploads/2017/06/UA006-Relevant-RFCs.pdf">RFCs</a><a style='mso-footnote-id:ftn1' href="#_ftn1" name="_ftnref1" title=""><sup>[1]</sup></a>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>There are other ways of making sure the data entered is what the user meant, such as requiring entry of the field twice and doing a compare.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>If you need to validate further, use a DNS lookup – that’s the most certain.&nbsp;&nbsp; Or if you’re going to use a local table, make sure that it’s from an authoritative source and that it’s updated at least daily.&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Storage<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>The easiest way to deal with storage is to support UTF-8.&nbsp;&nbsp; But for applications that can’t, there is an algorithm (Punycode)<a style='mso-footnote-id:ftn2' href="#_ftn2" name="_ftnref2" title=""><sup>[2]</sup></a> that allows transformation of domain names between ASCII and non-ASCII strings. NB: the Punycode conversion may NOT work for the mailbox name in an email address.&nbsp; Alternative encoding schemes exist and should be applied.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Processing<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>There are times when two different representations of a domain name are not the same but are equivalent.&nbsp; For example, when a non-ASCII domain name has been converted using the Punycode algorithm.&nbsp; When processing or sorting, it’s important that they are treated as equivalent.&nbsp;&nbsp; This will require some policies for the application or indeed the organization as to how domain names and email addresses are being dealt with.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Display<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Because domain names in non-ASCII characters (and mailbox names too) are growing more popular, you’ll need to make sure that you’re able to display them in a way that works for your community.&nbsp;&nbsp; Public facing applications should certainly display in native scripts and not an ASCII resulting from a Punycode transformation.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Check Libraries<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>A growing number of libraries, particularly Open Source Programming Language Libraries, will be correcting their validation routines, so being able to be UA Ready may be as simple as recompiling the code using the latest versions of the library.&nbsp;&nbsp; The UASG is encouraging remediation work in quite a number of libraries.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Github and SourceForge are also two good places to look to find working code.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>The UASG also publishes some good reference material at <a href="http://www.uasg.tech/documents">www.uasg.tech/documents</a>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Most efforts to get applications UA Ready will fall into the ‘Bug Fix’ level of effort.&nbsp; It’s time to get applications up to scratch.&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><br clear=all><o:p></o:p></span></p><div><div class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><hr size=1 width="33%" align=left></span></div></div></div><div><p class=MsoNormal><span style='font-family:"Times New Roman","serif"'><br clear=all><o:p></o:p></span></p><div class=MsoNormal><span style='font-family:"Times New Roman","serif"'><hr size=1 width="33%" align=left></span></div></div></div><div style='mso-element:footnote-list'><br clear=all><hr align=left size=1 width="33%"><div style='mso-element:footnote' id=ftn1><p class=MsoFootnoteText><a style='mso-footnote-id:ftn1' href="#_ftnref1" name="_ftn1" title=""><span class=MsoFootnoteReference>[1]</span></a> https://uasg.tech/wp-content/uploads/2017/06/UA006-Relevant-RFCs.pdf</p></div><div style='mso-element:footnote' id=ftn2><p class=MsoFootnoteText><a style='mso-footnote-id:ftn2' href="#_ftnref2" name="_ftn2" title=""><span class=MsoFootnoteReference>[2]</span></a> https://www.ietf.org/rfc/rfc3492.txt</p></div></div></body></html>