Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
.. -*-restructuredtext-*-

=================
FixUtf8 Extension
=================

This extension is not distributed with Mercurial.

Author: Stefan Rusek

Download site: http://bitbucket.org/stefanrusek/hg-fixutf8/changesets/ (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 withing 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

-----------------------------
Compatibility with TortoiseHg
-----------------------------

Where TortoiseHg uses python or mercurial filename api calls, it is compatibile with FixUtf8. This means that most of the dialogs work fine. Shell integration does not work perfectly, since the TortoiseHg shell extension converts the filenames to the non-Unicode 8-bit character strings, before calling passing them to mercurial. 

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.