I'm attempting to convert multiple files in batch from US-ASCII to UTF-8. I've narrowed the problem down to the iconv
comnand, which I appear to be using wrong, despite my best scouring of Stack Overflow. Any idea what's going wrong here?
Checking the encoding:
file -i accounting.cfm
accounting.cfm: text/html; charset=us-ascii
Attempt using iconv
to convert:
iconv -f us-ascii -t utf-8 accounting.cfm > accounting.cfm.recode
Check the encoding on the resultant file:
file -i accounting.cfm.recode
accounting.cfm.recode: text/html; charset=us-ascii
It seems the resultant file is still encoded for the US-ASCII charset. When I save a single file through Sublime as UTF-8 (Save With Encoding), it show the charset as utf-8. I understand the US-ASCII is a subset of UTF-8, but when I bring up the US-ASCII encoded file in the browser, I get garbage characters (the dreaded question marks in diamonds if loaded in a browser). This is for a legacy ColdFusion site. When I bring up the file Saved With Encoding through Sublime, my foreign character set appears properly. Any ideas what I'm doing wrong? Thanks.
file
prints the lowest common denominator; you just have to know what that means. Voting to close as unreproducible. – tripleeefile
command? Thanks for your reply. – FlipperPAcharacter-encoding
tag wiki for tips, at least on how to articulate a well-defined question. – tripleee