< Back
Test-Encoding
Post
NAME Test-Encoding
SYNOPSIS
Tests that the file can be read without erroring using the specified encoding.
SYNTAX
Test-Encoding [-Path] <String> [[-Encoding] <String>] [<CommonParameters>]
DESCRIPTION
Tests that the BOM, Encoding, and characters do not conflict. If no encoding is specified, infers the encoding
from the BOM. If no BOM is in the file and no Encoding is specified, assumes "ascii" encoding.
PARAMETERS
-Path <String>
The path of the file being tested
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Encoding <String>
Forces interpretation of the file as the specified encoding instead of only assuming the encoding from BOM.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Test-Encoding ".\\myFile.txt" -Encoding "utf8"
RELATED LINKS
SYNOPSIS
Tests that the file can be read without erroring using the specified encoding.
SYNTAX
Test-Encoding [-Path] <String> [[-Encoding] <String>] [<CommonParameters>]
DESCRIPTION
Tests that the BOM, Encoding, and characters do not conflict. If no encoding is specified, infers the encoding
from the BOM. If no BOM is in the file and no Encoding is specified, assumes "ascii" encoding.
PARAMETERS
-Path <String>
The path of the file being tested
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Encoding <String>
Forces interpretation of the file as the specified encoding instead of only assuming the encoding from BOM.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Test-Encoding ".\\myFile.txt" -Encoding "utf8"
RELATED LINKS