Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Using PowerShell to write a file in UTF-8 without the BOM
SUBMITTED BY:
Guest
DATE:
Nov. 14, 2013, 7:01 a.m.
FORMAT:
Text only
SIZE:
318 Bytes
Raw
Download
Tweet
HITS:
1487
Go to comments
Report
Using PowerShell to write a file in UTF-8 without the BOM
$MyFile = Get-Content $MyPath
$MyFile | Out-File -Encoding "UTF8" $MyPath
$MyFile = Get-Content $MyPath
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False)
[System.IO.File]::WriteAllLines($MyPath, $MyFile, $Utf8NoBomEncoding)
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus