11---
22description : Describes how PowerShell uses character encoding for input and output of string data.
33Locale : en-US
4- ms.date : 03/09/2023
4+ ms.date : 10/21/2025
55online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7.5&WT.mc_id=ps-gethelp
66schema : 2.0.0
77title : about_Character_Encoding
1717
1818Unicode is a worldwide character-encoding standard. The system uses Unicode
1919exclusively for character and string manipulation. For a detailed description
20- of all aspects of Unicode, refer to [ The Unicode Standard] [ 01 ] .
20+ of all aspects of Unicode, refer to [ The Unicode Standard] [ 07 ] .
2121
2222Windows supports Unicode and traditional character sets. Traditional character
2323sets, such as Windows code pages, use 8-bit values or combinations of 8-bit
@@ -91,7 +91,7 @@ In PowerShell 5.1, the **Encoding** parameter supports the following values:
9191- ` UTF7 ` Uses UTF-7.
9292- ` UTF8 ` Uses UTF-8 (with BOM).
9393
94- In general, Windows PowerShell uses the Unicode [ UTF-16LE] [ 03 ] encoding by
94+ In general, Windows PowerShell uses the Unicode [ UTF-16LE] [ 06 ] encoding by
9595default. However, the default encoding used by cmdlets in Windows PowerShell
9696is not consistent.
9797
@@ -174,7 +174,7 @@ PowerShell defaults to `utf8NoBOM` for all output.
174174Beginning with PowerShell 6.2, the ** Encoding** parameter also allows numeric
175175IDs of registered code pages (like ` -Encoding 1251 ` ) or string names of
176176registered code pages (like ` -Encoding "windows-1251" ` ). For more information,
177- see the .NET documentation for [ Encoding.CodePage] [ 04 ] .
177+ see the .NET documentation for [ Encoding.CodePage] [ 08 ] .
178178
179179Starting with PowerShell 7.4, you can use the ` ANSI ` value for the ** Encoding**
180180parameter to pass the numeric ID for the current culture's ANSI code page
@@ -189,7 +189,7 @@ encoding behavior.
189189- ` $OutputEncoding `
190190- ` $PSApplicationOutputEncoding `
191191
192- For more information, see [ about_Preference_Variables] [ 05 ] .
192+ For more information, see [ about_Preference_Variables] [ 04 ] .
193193
194194Beginning in PowerShell 5.1, the redirection operators (` > ` and ` >> ` ) call the
195195` Out-File ` cmdlet. Therefore, you can set the default encoding of them using
@@ -216,24 +216,28 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8'
216216> behave the same way even when run by another user, on a different computer,
217217> or in a different version of PowerShell.
218218
219- The automatic variables ` $OutputEncoding ` and ` $PSApplicationOutputEncoding `
220- affects the encoding PowerShell uses to when sending data into and reading
221- from external programs respectively. They have no effect on the encoding that
222- the output redirection operators and PowerShell cmdlets use to save to files.
219+ The automatic variables ` $OutputEncoding ` affects the encoding PowerShell uses
220+ to when sending data to external programs. The ` $PSApplicationOutputEncoding `
221+ variable affects the encoding PowerShell uses to read data from external
222+ programs. They have no effect on the encoding that the output redirection
223+ operators and PowerShell cmdlets use to save to files.
223224
224225## See also
225226
226- - [ about_Preference_Variables] [ 05 ]
227- - [ Byte order mark] ( https://wikipedia.org/wiki/Byte_order_mark )
228- - [ Code Pages - Win32 apps] ( /windows/win32/intl/code-pages )
229- - [ Encoding.CodePage] [ 04 ]
230- - [ Introduction to character encoding in .NET] ( /dotnet/standard/base-types/character-encoding-introduction )
231- - [ The Unicode Standard] [ 01 ]
232- - [ UTF-16LE] [ 03 ]
227+ - [ about_Preference_Variables] [ 04 ]
228+ - [ Byte order mark] [ 05 ]
229+ - [ Code Pages - Win32 apps] [ 03 ]
230+ - [ Encoding.CodePage] [ 08 ]
231+ - [ Introduction to character encoding in .NET] [ 01 ]
232+ - [ The Unicode Standard] [ 07 ]
233+ - [ UTF-16LE] [ 06 ]
233234
234235<!-- link references -->
235- [ 01 ] : https://www.unicode.org/ standard/standard.html
236+ [ 01 ] : /dotnet/ standard/base-types/character-encoding-introduction
236237[ 02 ] : /globalization/encoding/byte-order-mark
237- [ 03 ] : https://wikipedia.org/wiki/UTF-16
238- [ 04 ] : /dotnet/api/system.text.encoding.codepage
239- [ 05 ] : about_Preference_Variables.md
238+ [ 03 ] : /windows/win32/intl/code-pages
239+ [ 04 ] : about_Preference_Variables.md
240+ [ 05 ] : https://wikipedia.org/wiki/Byte_order_mark
241+ [ 06 ] : https://wikipedia.org/wiki/UTF-16
242+ [ 07 ] : https://www.unicode.org/standard/standard.html
243+ [ 08 ] : xref:System.Text.Encoding.CodePage%2A
0 commit comments