ubuntu下打开windows c/cpp等文件中文乱码问题
来源:互联网 发布:公司数据部门职责 编辑:程序博客网 时间:2024/06/11 11:16
在linux操作系统下,我们有时打开在windows下的c/cpp等文件,发现在windows下能正常显示的文件出现了中文乱码。
出现这种情况的原因为两种操作系统的中文压缩方式不同,在windows环境中中文压缩一般为gbk,而在linux环境中为utf8,这就导致了在windows下能正常显示
c/cpp/txt等文件在linux环境下打开呈现了乱码状态。
解决方法:在linux用iconv命令,如乱码文件名为test.cpp,那么在终端输入如下命令:
iconv -f gbk -t utf8 test.cpp > test.cpp.utf8
打开test.cpp.utf8文件,发现中文不再是乱码啦
参考文章:http://blog.csdn.net/imyang2007/article/details/7448177
0 0
- ubuntu下打开windows c/cpp等文件中文乱码问题
- 解决ubuntu打开windows下保存的txt文件中文乱码问题
- 解决Ubuntu下打开Windows文本文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- Gentoo下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- linux下打开windows txt文件中文乱码问题
- windows文件(.txt,.h,.cpp等等)中的中文在ubuntu下乱码的解决方法
- ubuntu下打开txt文件乱码问题
- c语言-简易学生管理系统
- java程序员必看书籍
- Ecshop在php 5.3以上版本安装过程中出现的问题
- iOS 6的rotation
- ios获取当前年月日和星期
- ubuntu下打开windows c/cpp等文件中文乱码问题
- HDOJ1050 Moving Tables
- 1069. The Black Hole of Numbers<必看>
- build keil project
- 简单的点对点聊天软件
- 外网访问内网机器
- PHP学习 mysqli 预处理更新
- PAT Basic Level 1023. 组个最小数(20)
- 【2】前台线程和后台线程