{"id":39283,"date":"2004-05-18T07:00:00","date_gmt":"2004-05-18T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2004\/05\/18\/string-sorting-is-not-done-by-ascii-code-any-more\/"},"modified":"2004-05-18T07:00:00","modified_gmt":"2004-05-18T07:00:00","slug":"string-sorting-is-not-done-by-ascii-code-any-more","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20040518-00\/?p=39283","title":{"rendered":"String sorting is not done by ASCII code any more."},"content":{"rendered":"<p>\nJust because you have\n<a HREF=\"http:\/\/www.prepressure.com\/library\/binhex.htm\">\nthe ASCII table<\/a> memorized\ndoesn&#8217;t mean you know how sorting works.\n<\/p>\n<p>\nI remember a bug filed where somebody said that the &#8220;sort&#8221;\ncommand was sorting underscores incorrectly:\n<\/p>\n<pre>\nAAA__\nAAAAA\n<\/pre>\n<p>\nthis was claimed to be wrong &#8220;because underscore character\nfollow uppercase letters and precedes lowercase letters&#8221;.\n<\/p>\n<p>\nWell perhaps it does if you think ASCII sorting is the way\nsorting should be.\n<\/p>\n<p>\nASCII sorting is so last century.\n<\/p>\n<p>\nThe\n<a HREF=\"http:\/\/msdn.microsoft.com\/library\/en-us\/winui\/winui\/windowsuserinterface\/resources\/strings\/stringreference\/stringfunctions\/comparestring.asp\">\nCompareString function<\/a>\ndescribes two types of sorting, &#8220;word sort&#8221; and &#8220;string sort&#8221;.\nAnd both of them sort punctuation before letters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just because you have the ASCII table memorized doesn&#8217;t mean you know how sorting works. I remember a bug filed where somebody said that the &#8220;sort&#8221; command was sorting underscores incorrectly: AAA__ AAAAA this was claimed to be wrong &#8220;because underscore character follow uppercase letters and precedes lowercase letters&#8221;. Well perhaps it does if you [&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":[25],"class_list":["post-39283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Just because you have the ASCII table memorized doesn&#8217;t mean you know how sorting works. I remember a bug filed where somebody said that the &#8220;sort&#8221; command was sorting underscores incorrectly: AAA__ AAAAA this was claimed to be wrong &#8220;because underscore character follow uppercase letters and precedes lowercase letters&#8221;. Well perhaps it does if you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/39283","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=39283"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/39283\/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=39283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=39283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=39283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}