开发者

unzip utf8 to ascii

i took some files from linux hosting to my windows via ftp and when i check file encodings utf8 without bom

now i need to convert those files back to ascii and send my other linux server

i zipped files can i do something like

unzip if its text file and ut8 format than convert it to ascii

when i am unzipping files , i want to make conversion

开发者_JS百科

thanks ?


The program you're looking for is iconv; it will convert between encodings. Use it like this:

iconv -f utf-8 -t ascii < infile > outfile

However. ASCII is a subset of UTF-8. That is, a file that's written in ASCII is also correct UTF-8 --- no conversion is needed. The only reason for needing to convert the other way is if there are characters in your UTF-8 file that are outside the ASCII range. And if this is the case, you can't convert it to ASCII, because ASCII doesn't have those characters!

Are you sure you mean ASCII? Pure ASCII is rare these days. ISO-8859-15 (Western European) or CP1252 (Windows) are much more common.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜