How to convert ISO8859-15 to UTF8?

后端 未结 8 2040
情歌与酒
情歌与酒 2020-12-12 18:04

I have an Arabic file encoded in ISO8859-15. How can I convert it into UTF8?
I used iconv but it doesn\'t work for me.

iconv -f ISO-8859-15          


        
8条回答
  •  没有蜡笔的小新
    2020-12-12 18:21

    Iconv just writes the converted text to stdout. You have to use -o OUTPUTFILE.txt as an parameter or write stdout to a file. (iconv -f x -t z filename.txt > OUTPUTFILE.txt or iconv -f x -t z < filename.txt > OUTPUTFILE.txt in some iconv versions)

    Synopsis
    
    iconv -f encoding -t encoding inputfile
    
    Description
    
    The iconv program converts the encoding of characters in inputfile from one coded character set to another. 
    **The result is written to standard output unless otherwise specified by the --output option.**
    
    --from-code, -f encoding
    
    Convert characters from encoding
    
    --to-code, -t encoding
    
    Convert characters to encoding
    
    --list
    
    List known coded character sets
    
    --output, -o file
    
    Specify output file (instead of stdout)
    
    --verbose
    
    Print progress information.
    

提交回复
热议问题