I'm trying to convert a file System.Web.WebPages.Razor.dll.refresh
from ASCII to UTF-16LE. When I run the file -i
command on other refresh files in the directory, I get something like:
System.Web.Optimization.dll.refresh: text/plain; charset=utf-16le
And when I run it on my target file I get:
System.Web.WebPages.Razor.dll.refresh: text/plain; charset=us-ascii
I think this encoding difference is causing an error in my build pipeline, so I'm trying to convert this ASCII file to UTF-16LE so it's like the other refresh files. However, iconv
doesn't seem to be giving me the output I'm looking for.
My command:
iconv -f US-ASCII -t UTF-16LE "System.Web.WebPages.Razor.dll.refresh" > "System.Web.WebPages.Razor.dll.refresh.new" && mv -f "System.Web.WebPages.Razor.dll.refresh.new" "System.Web.WebPages.Razor.dll.refresh"
There are two issues with the output.
1) It spaces the file out (i.e. from this
to t h i s
).
2) When I run file -i
on this new file, I get the following output:
System.Web.WebPages.Razor.dll.refresh: application/octet-stream; charset=binary
Why am I getting this binary output, and why is it spacing out the text? Is there a better way to convert this file to the proper encoding?