---
title: "Linux-Windows文件编码"
author: "iamsk"
date: "2010-10-17T12:57:21Z"
tags: []
categories: ["操作系统"]
slug: "linux-windows"
draft: false
lastmod: "2010-10-17T14:00:28Z"
id: 786736
url: "https://iamsk.iteye.com/blog/786736"
---

在linux和windows下，经常需要共享一些文档，最方便的方法就是编码均设置为utf-8。

但是经常会因为win下默认为gb2312而导致到linux查看有问题

此时可以使用openoffice进行查看，并选择编码为gb2312

如果要搞成utf-8的，那就得直接在openoffice里ctrl+c，然后到其他文本编辑里ctrl+v了

这里有个不错的命令，可以实现：enca

sudo apt-get install enca

enca -x UTF- 8 test.txt

即可

使用 enca test.txt，可以查看文件编码

：）

 

自iamsk7.appspot.com转移，2010-09-11，准备放弃自己做的blog ;)