Home » Questions » Computers [ Ask a new question ]

convert file type to utf-8 on unix - iconv is failing [duplicate]

convert file type to utf-8 on unix - iconv is failing [duplicate]

I've got a php file on my windows machine that upon moving over to *nix with winSCP, is not showing the characters correctly.

Asked by: Guest | Views: 277
Total answers/comments: 1
Guest [Entry]

"Are you sure ""ANSI"" is the correct character encoding/input name for iconv? You could try to run ""file filename.php"", often file will tell (what it thinks) the encoding is. You could also try to not specify the from encoding when doing the conversion, or you could just try all of them:

for i in `iconv -l`; do iconv -f $i -t utf-8 filename.php > filename.php.$i; done"