{"id":79655,"date":"2016-08-12T11:59:03","date_gmt":"2016-08-12T18:59:03","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=79655"},"modified":"2019-02-18T09:10:28","modified_gmt":"2019-02-18T16:10:28","slug":"powertip-identify-the-numeric-value-of-a-custom-dingbat-character-using-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-identify-the-numeric-value-of-a-custom-dingbat-character-using-powershell\/","title":{"rendered":"PowerTip: Identify the numeric value of a custom (dingbat) character using PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Use PowerShell to determine the value of an Extended ASCII character to reproduce it for later use.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/> I have a really simple question that\u2019s been bugging me. I have a string with a special (Extended ASCII) character that I scraped from some output. I can\u2019t find the ASCII value of it to reproduce it. How can I get the value of this silly \u201cDingbat\u201d?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/> In PowerShell, all you need to use is the <strong>[int]<\/strong> accelerator to get its numerical value!<\/p>\n<p style=\"padding-left: 60px\">For example, if your special character is stored as a single character in a string called $char, you can find the value like this:<\/p>\n<p style=\"padding-left: 90px\"><code>[int]$char<\/code><\/p>\n<p style=\"padding-left: 60px\">For the hexadecimal value, just run the results through the <strong>[convert]<\/strong> accelerator as in the following example:<\/p>\n<p style=\"padding-left: 90px\"><code>[convert]::tostring([int]$char,16)<\/code><\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\"The Doctor\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use PowerShell to determine the value of an Extended ASCII character to reproduce it for later use. I have a really simple question that\u2019s been bugging me. I have a string with a special (Extended ASCII) character that I scraped from some output. I can\u2019t find the ASCII value of it to reproduce it. [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568,639,685],"tags":[696,56,356,45],"class_list":["post-79655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","category-powertip","category-scripting-techniques","tag-chendrayan-venkatesan","tag-guest-blogger","tag-powertip","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use PowerShell to determine the value of an Extended ASCII character to reproduce it for later use. I have a really simple question that\u2019s been bugging me. I have a string with a special (Extended ASCII) character that I scraped from some output. I can\u2019t find the ASCII value of it to reproduce it. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=79655"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79655\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=79655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=79655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=79655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}