Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

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
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants