{"id":106697,"date":"2022-05-31T07:00:00","date_gmt":"2022-05-31T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=106697"},"modified":"2022-05-31T10:58:04","modified_gmt":"2022-05-31T17:58:04","slug":"20220531-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20220531-00\/?p=106697","title":{"rendered":"The <CODE>activeCodePage<\/CODE> manifest element can be used for more than just setting UTF-8 as the active code page"},"content":{"rendered":"<p>Windows 10 Version 1903 introduced a new manifest property called <code>activeCodePage<\/code>, which you can use to <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/apps\/design\/globalizing\/use-utf8-code-page#set-a-process-code-page-to-utf-8\"> set the process&#8217;s code page to UTF-8<\/a>.<\/p>\n<p>Starting in Windows Server 2022 (and Windows 11),\u00b9 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/sbscs\/application-manifests#activecodepage\"> you can also use this property to pick non-UTF-8 code pages<\/a> in unpackaged app manifests.\u00b2<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/AppLocale\">AppLocale<\/a> finally grows up!<\/p>\n<p>If you specify an <code>activeCodePage<\/code> of <code>Legacy<\/code>, then you&#8217;re saying that your application actively hates UTF-8. It will be given the system default locale, provided a system default local exists and it isn&#8217;t UTF-8. In those exceptional cases, you get code page 1252 as a fallback.<\/p>\n<p>You can also specify a locale name such as <code>en-US<\/code> or <code>ja-JP<\/code>, and the application gets the code page corresponding to that locale. If the locale is not recognized by the system, then you get UTF-8 as a fallback.<\/p>\n<p>This trick is most useful for application compatibility purposes: If you have some legacy application that assumes a specific locale, you can deploy a manifest next to the application that says &#8220;I don&#8217;t care what locale the system is using. Give this application the locale it wants.&#8221;<\/p>\n<p>Here&#8217;s a summary table, since I know people love summary tables.<\/p>\n<table class=\"cp3\" style=\"border-collapse: collapse;\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n<tbody>\n<tr>\n<th>activeCodePage<\/th>\n<td><code>UTF-8<\/code><\/td>\n<td>specific locale<\/td>\n<td><code>Legacy<\/code><\/td>\n<\/tr>\n<tr>\n<th>Case-sensitive?<\/th>\n<td>Yes<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<th valign=\"top\">Preferred result<\/th>\n<td valign=\"top\">UTF-8<\/td>\n<td valign=\"top\">That locale,<br \/>\nif available<\/td>\n<td valign=\"top\">System locale,<br \/>\nif available,<br \/>\nand not UTF-8<\/td>\n<\/tr>\n<tr>\n<th>Fallback result<\/th>\n<td>&nbsp;<\/td>\n<td>UTF-8<\/td>\n<td>1252<\/td>\n<\/tr>\n<tr>\n<th>Packaged app<\/th>\n<td>Supported<\/td>\n<td>Not supported<\/td>\n<td>Not supported<\/td>\n<\/tr>\n<tr>\n<th>Unpackaged app<\/th>\n<td>Supported<\/td>\n<td>Supported<\/td>\n<td>Supported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00b9 Specifically, build 20348 and higher, so that also includes HoloLens 2, also known as Windows Holographic, version 21H1.<\/p>\n<p>\u00b2 The code name for unpackaged app manifests\u00b3 was &#8220;fusion&#8221;, so if you read the documentation, you will frequently see them referred to as &#8220;fusion manifests&#8221;.<\/p>\n<p>\u00b3 They weren&#8217;t called &#8220;unpackaged app manifests&#8221; at the time, because when the fusion project was being written, we didn&#8217;t have packaged apps at all. They were just called &#8220;manifests&#8221;. Later, when manifests were introduced for packaged apps, the retronym &#8220;unpackaged app manifests&#8221; was invented to describe fusion manifests.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AppLocale grows up.<\/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,104],"class_list":["post-106697","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>AppLocale grows up.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/106697","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=106697"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/106697\/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=106697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=106697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=106697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}