- 注册时间
- 2010-11-11
- 最后登录
- 2025-5-27
- 阅读权限
- 200
- 积分
- 14361
- 精华
- 2
- 帖子
- 843
  

TA的每日心情 | 无聊 2025-5-27 03:37:20 |
---|
签到天数: 366 天 [LV.9]以坛为家II
我玩的应用:
  
|
基础知识乱码原因- 在文件名“\”可能被包括在内。
- Windows使用“\”分割路径,而Unix是“/”
- Windows和Linux环境与不同的编码环境
三种解决办法
win32mbcshg-fixutf8Cygwin的Mercurial- Cygwin的1.7文件名处理为UTF - 8。基于这个原因,Cygwin的版本的Linux和Mercurial可用于互操作。然而,TortoiseHg和图形用户界面不可用。
比较表 | 字码 | 解决乱码 | 多个操作系统 | 图形用户界面 | 默认 | GBK | × | × | ○ | win32mbcs | GBK | ○ | × | ○ | hg-fixutf8 | 使用UTF - 8 | ○ | ○ | ○ | Cygwin | 使用UTF - 8 | ○ | ○ | × | Fixutf8安装方法- 运行 hg clone http://bitbucket.org/stefanrusek/hg-fixutf8。可以得到一个文件夹,
- 将这个文件夹拷贝到你想拷贝的地方。我拷贝在C:\Program Files\TortoiseHg\hg-fixutf8
- 在C:\Users\yankai (yankai是我的用户名)下有一个隐藏文件mercurial.ini,如果没有创建一个,在他后面添上[extensions]fixutf8 = C:\Program Files\TortoiseHg\hg-fixutf8\fixutf8.py
ok,乱码问题应该已经解决了。
----------
FixUtf8 Extension
This extension is not distributed with Mercurial.
Author: Stefan Rusek
Repository: https://bitbucket.org/stefanrusek/hg-fixutf8/
This extension appears to be incompatible with Mercurial 2.0 and later.
Compatibility: requires Mercurial 1.1 or later and Python 2.5 or later
This extension is still in beta, use it at your own risk.
Overview
This extension corrects filename encoding problems on Windows.
Windows internally stores all command line arguments and filenames in Unicode UTF-16 (16-bit character strings), and for backward compatibility with Windows 3.x, provides functions to retrieve them in non-Unicode 8-bit character strings. Python 2.x and Mercurial call the non-Unicode functions. This causes Mercurial to misbehave when used with filenames that contain Unicode characters. This extension resolves this issue, by making sure that the Unicode functions are called. Since Mercurial expects 8-bit character strings, the extension converts the strings to UTF-8 before returning them to Mercurial.
There is one case where FixUtf8 fails to add support for Unicode, because the repository object for the current working directory is created before extensions are loaded. There is nothing that FixUtf8 can do to fix the problem of a repository residing within a
directory with Unicode characters in it. However, FixUtf8 does not have a problem with directories with Unicode characters inside
of the repository.
Ideally, you enable the extension before you need international filenames, but if you already have international filenames in your repo, then you need to fix your filenames.
In order for Unicode characters to display properly, you should change the Windows console font from "Raster Fonts" to "Lucida Console".
Fixing existing filenames
To fix your filenames simply do the following:
>hg addremove -s 100
>hg commit -m "Fix filenames"
Configuration
Configure your .hgrc to enable the extension by adding following lines:
[extensions]
fixutf8 = path/to/fixutf8.py ------
|
|