V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
sobigfish
V2EX  ›  Python

一点python都不懂,求个python将目录以及子目录下文件 gbk转utf-8的py for sublime text2

  •  
  •   sobigfish · 2012-02-14 20:23:54 +08:00 · 3229 次点击
  •   指定的图片不存在
    这是一个创建于 4475 天前的主题,其中的信息可能已经有所发展或是发生改变。
    一点python都不懂,求个python将目录以及子目录下文件 gbk转utf-8的py for sublime text2
    感谢

    要是有高人直接写成sublime的插件更好
    4 条回复    1970-01-01 08:00:00 +08:00
    binux
        1
    binux  
       2012-02-14 20:28:46 +08:00
    转换编码和用什么语言有什么关系?
    如果非得python的话
    G+上某人写的

    all2utf: all2utf [pattern] [-R]
    Auto detect the encoding of text files and conver them into UTF-8.
    A few pattern examples are: *.txt, *.* etc.

    https://github.com/airyai/pwx-scripts/blob/master/all2utf
    sobigfish
        2
    sobigfish  
    OP
       2012-02-14 20:36:22 +08:00
    @binux 因为sublime text2的支持py的的插件
    kojp
        3
    kojp  
       2012-02-14 20:46:25 +08:00
    我也曾经 有过这个需求 ,但忘记写了还是没写了 ...,
    gavingeng
        4
    gavingeng  
       2012-02-14 21:14:58 +08:00
    iconv 或者enca就能做转码

    py只是替换过coding:gb2312 -->coding:utf-8
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2820 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:40 · PVG 19:40 · LAX 04:40 · JFK 07:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.