Mercurial problems with Danish letters

Mercurial can have problems with handling non ASCII letters in file names, comments etc. when it across different platforms (Windows, Unix, MacOSX). I have even experienced the problem within different versions of Windows.

The problem: File names containg e.g. æøå is renamed to æøå…

This solution worked for me. I use TortoiseHG which is installed in c:\program files (x86)\TortoiseHG.

  1. Create a folder called extensions in c:\program files (x86)\TortoiseHG
  2. Extract the content of the following file to the extensions folder (hg-fixutf8 or access the files here https://bitbucket.org/stefanrusek/hg-fixutf8)
  3. You should now have a path to the following file: c:\Program Files (x86)\TortoiseHg\extensions\hg-fixutf8\fixutf8.py
  4. Open C:\Users\[Username]\mercurial.ini in Notepad or another text editor
  5. Add the following extension so your mercurial.ini looks something like this
# Generated by TortoiseHg setting dialog

[ui]
username = [YOUR USERNAME]

[extensions]
fixutf8 = C:\Program Files (x86)\TortoiseHg\extensions\hg-fixutf8\fixutf8.py

With that in place, the first time you update your working copy file names will be corrected. If you already have updated your working copy, then do a clean update.

About Mikkel Ovesen

I am a .NET developer, primarily developing apps for the web. I have been working with the web since 1997. I like open-source software and burgers ;)
This entry was posted in Development, Software and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>