Use UTF-8 code pages in Windows apps - Microsoft Learn
文章推薦指數: 80 %
UTF-8 is the universal code page for internationalization and is able to encode the entire Unicode character set. It is used pervasively on the ...
Skiptomaincontent
Thisbrowserisnolongersupported.
UpgradetoMicrosoftEdgetotakeadvantageofthelatestfeatures,securityupdates,andtechnicalsupport.
DownloadMicrosoftEdge
MoreinfoaboutInternetExplorerandMicrosoftEdge
Tableofcontents
Exitfocusmode
ReadinEnglish
Save
Tableofcontents
ReadinEnglish
Save
Feedback
Edit
Print
Twitter
LinkedIn
Facebook
Email
Tableofcontents
UseUTF-8codepagesinWindowsapps
Article
04/20/2022
2minutestoread
4contributors
Inthisarticle
UseUTF-8characterencodingforoptimalcompatibilitybetweenwebappsandother*nix-basedplatforms(Unix,Linux,andvariants),minimizelocalizationbugs,andreducetestingoverhead.
UTF-8istheuniversalcodepageforinternationalizationandisabletoencodetheentireUnicodecharacterset.Itisusedpervasivelyontheweb,andisthedefaultfor*nix-basedplatforms.
SetaprocesscodepagetoUTF-8
AsofWindowsVersion1903(May2019Update),youcanusetheActiveCodePagepropertyintheappxmanifestforpackagedapps,orthefusionmanifestforunpackagedapps,toforceaprocesstouseUTF-8astheprocesscodepage.
Youcandeclarethispropertyandtarget/runonearlierWindowsbuilds,butyoumusthandlelegacycodepagedetectionandconversionasusual.WithaminimumtargetversionofWindowsVersion1903,theprocesscodepagewillalwaysbeUTF-8solegacycodepagedetectionandconversioncanbeavoided.
Note
Anencodedcharactertakesbetween1and4bytes.UTF-8encodingsupportslongerbytesequences,upto6bytes,butthebiggestcodepointofUnicode6.0(U+10FFFF)onlytakes4bytes.
Examples
Appxmanifestforapackagedapp:
延伸文章資訊
- 1UTF-8 Tool
Character name, NULL. Hex code point, 0000. Decimal code point, 0. Hex UTF-8 bytes, 00. Octal UTF...
- 2What is UTF-8? - Twilio
- 3UTF-8 encoding table and Unicode characters
UTF-8 encoding table and Unicode characters. page with code points U+0000 to U+00FF. Share on Fac...
- 4UTF-8 - Wikipedia
UTF-8 is a variable-width character encoding used for electronic communication. Defined by the Un...
- 5UTF-8 code page - Charset.org