Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Get-FileEncoding cmdlet #42

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ArmaanMcleod
Copy link

Moved from PowerShell/PowerShell#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

Copy link
Member

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ArmaanMcleod
Copy link
Author

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

@JamesWTruher Conflicts resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants