I tried to make a simple commit through my wrapper library for Mercurial, using plain Unicode:æøåÆØÅ text Unicode:æøåÆØÅ as a commit message. This is written to a text file and assigned to Mercurial with the appropriate parameter:
hg commit
If I later watch the repository with TortoiseHg, the characters will play correctly. On the console, they are distorted:
[C: \ Temp]: hg log
changeset: 0: 6a0911410128
tag: tip
user: Lasse V. Karlsen
date: Wed Dec 01 21:48:54 2010 +0100
summary: Unicode: æøåÆØÅ
If I redirect the output of hg log to a file and open it, æøåÆØÅ plays correctly.
So my question is this:
- Can I ask
hg to write the log to a file directly or do I need to redirect standard output? - This will cause python encoding problems for the console, i.e. will some characters crash
hg instead of just outputting the result? - Is there a known supported commit message encoding that I have to stick to?
Or is it just like this:
- Mercurial doesn't care, it takes the contents of the file that I give it, regardless of the contents, and saves it as a commit message. When you create a log, it just dumps it back to the console, falling prey to any restrictions available in this area for the Python console output library?
mercurial unicode
Lasse Vågsæther Karlsen
source share