UTF8 encoding without BOM - PowerShell -
i have bat file encode csv files. problem there 1 character @ begining of file once encoding have been done (bom byte guess). character bothers me cause after encoding, use file generate database. here line encoding (inside bat file):
powershell -command "&{ param($path); (get-content $path) | out-file $path -encoding utf8 }" csvs\\pass.csv
is there way encode file without bom (if problem)??
thanks!
i found solution. change line this:
powershell -command "&{ param($path); $utf8nobomencoding = new-object system.text.utf8encoding($false); $myfile = get-content $path; [system.io.file]::writealllines($path, $myfile, $utf8nobomencoding) }" csvs\\pass.csv
Comments
Post a Comment