TextUtility icon indicating copy to clipboard operation
TextUtility copied to clipboard

Added `Get-FileEncoding` cmdlet

Open ArmaanMcleod opened this issue 2 years ago • 1 comments

Moved from https://github.com/PowerShell/PowerShell/pull/20586.

Added Get-FileEncoding cmdlet to detect encoding from file using System.IO.StreamReader.CurrentEncoding.

Parameter Sets

Get-FileEncoding [-Path] <string> [<CommonParameters>]

Get-FileEncoding [-LiteralPath] <string> [<CommonParameters>]

Usage

> Get-FileEncoding -Path .\.markdownlint.json

Preamble          :
BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

ArmaanMcleod avatar Nov 04 '23 11:11 ArmaanMcleod

this is looking very good. @ArmaanMcleod could you address the merge conflicts?

@JamesWTruher Conflicts resolved :)

ArmaanMcleod avatar Jun 27 '24 13:06 ArmaanMcleod