解压utf8为ascii
我通过 ftp 将一些文件从 linux 托管到我的 windows 当我检查没有 bom 的文件编码 utf8 时
,现在我需要将这些文件转换回 ascii 并将
我压缩的文件 发送给我的其他 Linux 服务器 我可以做类似解压缩的事情吗
如果它的文本文件和 ut8 格式比将其转换为 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
thanks ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的程序是 iconv;它将在编码之间进行转换。像这样使用它:
但是。 ASCII 是 UTF-8 的子集。也就是说,以 ASCII 编写的文件也是正确的 UTF-8 — 无需转换。需要以其他方式转换的唯一原因是 UTF-8 文件中存在超出 ASCII 范围的字符。如果是这种情况,您无法将其转换为 ASCII,因为 ASCII 没有这些字符!
你确定你说的是ASCII吗?现在纯 ASCII 已经很少见了。 ISO-8859-15(西欧)或 CP1252(Windows)更为常见。
The program you're looking for is iconv; it will convert between encodings. Use it like this:
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.