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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -