Python论坛  - 讨论区

标题:[python-chinese] 如何把 一个 gb2312 编码的 文本文件, 转换成 utf8 编码?

2006年06月04日 星期日 14:53

lubiao lubiao.py at gmail.com
Sun Jun 4 14:53:08 HKT 2006

如题, 谢谢!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060604/78303d79/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月04日 星期日 14:56

Peng Xiaoyu peng.xiaoyu at gmail.com
Sun Jun 4 14:56:53 HKT 2006

iconv -f gb2312 -t utf8 inputfilename > outputfilename

在06-6-4,lubiao <lubiao.py at gmail.com> 写道:
>
> 如题, 谢谢!
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060604/7e455a77/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月04日 星期日 15:10

王韬 itkingtao at 126.com
Sun Jun 4 15:10:36 HKT 2006

不知道,难道是查表?
可以去看看标准吗
http://www.unicode.org/versions/Unicode4.1.0/
  ----- Original Message ----- 
  From: lubiao 
  To: python-chinese-email-lists 
  Sent: Sunday, June 04, 2006 2:53 PM
  Subject: [python-chinese] 如何把 一个 gb2312 编码的 文本文件, 转换成 utf8 编码?


  如题, 谢谢!



------------------------------------------------------------------------------


  _______________________________________________
  python-chinese
  Post: send python-chinese at lists.python.cn
  Subscribe: send subscribe to python-chinese-request at lists.python.cn
  Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
  Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060604/afe7115d/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月04日 星期日 15:13

lubiao lubiao.py at gmail.com
Sun Jun 4 15:13:22 HKT 2006

在 windows 上 怎么办? 我想把几千个文本文件,转换成 utf8 编码。

On 6/4/06, Peng Xiaoyu <peng.xiaoyu at gmail.com> wrote:
>
> iconv -f gb2312 -t utf8 inputfilename > outputfilename
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060604/29b3a44b/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月04日 星期日 16:52

Shixin Zeng zeng.shixin at gmail.com
Sun Jun 4 16:52:26 HKT 2006

import codecs
fi = codecs.open("gb2312_file", "r", "gb2312")
fo = codecs.open("utf8_file", "w", "UTF-8")
for line in fi.readlines():
    fo.write(line)
fi.close()
fo.close()

On 6/4/06, lubiao <lubiao.py at gmail.com> wrote:
>
> 在 windows 上 怎么办? 我想把几千个文本文件,转换成 utf8 编码。
>
> On 6/4/06, Peng Xiaoyu <peng.xiaoyu at gmail.com> wrote:
>
> > iconv -f gb2312 -t utf8 inputfilename > outputfilename
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
Best Regards

Shixin Zeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060604/5acfb9d8/attachment-0001.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月05日 星期一 09:37

wu wunc superwunc at gmail.com
Mon Jun 5 09:37:51 HKT 2006

Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?GB2312?B?R0JL16p1dGY4xfrBv9equ7u5pL7fLnppcA==?=
Type: application/zip
Size: 24236 bytes
Desc: not available
Url : http://lists.exoweb.net/pipermail/python-chinese/attachments/20060605/9e1f1736/GB2312BR0JL16p1dGY4xfrBv9equ7u5pL7fLnppcA-0001.zip

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月05日 星期一 16:38

Leira Hua lhua at altigen.com.cn
Mon Jun 5 16:38:59 HKT 2006

follow the steps:
1. uninstall windows. (just kill the patitions, it's easy)
2. install a linux distribution. (Debian is good)
3. iconv -f gb2312 -t utf8 inputfilename > outputfilename
Done


:) just a joke

On Sun, 04 Jun 2006 15:13:22 +0800, lubiao  
<lubiao.py at gmail.com> wrote:

> 在 windows 上 怎么办? 我想把几千个文本文件,转换成 utf8 编码。
>
> On 6/4/06, Peng Xiaoyu <peng.xiaoyu at gmail.com> wrote:
>>
>> iconv -f gb2312 -t utf8 inputfilename > outputfilename
>>
>> _______________________________________________
>> python-chinese
>> Post: send python-chinese at lists.python.cn
>> Subscribe: send subscribe to python-chinese-request at lists.python.cn
>> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>
>>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号