encoding of 'hg convert' output

FUJIWARA Katsunori fujiwara at ascade.co.jp
Wed Aug 26 22:10:51 CDT 2009

Hi all.

'convert' function overrides encoding configuration by UTF-8.

    def convert(ui, src, dest=None, revmapfile=None, **opts):
        global orig_encoding
        orig_encoding = encoding.encoding
        encoding.encoding = 'UTF-8'

I interpret this as assurance of internal processing in UTF-8 while

# or any other reasons ?

But this overriding forces encoding of 'hg convert' output to be UTF-8
unexpectedly, when user specifies another encoding.

So, I think that the result of gettext(), which is encoded by UTF-8,
should be re-encoded by 'orig_encoding', at least for
ui.warn()/status()/note()/debug()-ed and raise-d messages.

# 'recode()' in convcmd.py is available for this purpose, isn't it ?

Please comment on it.

More information about the Mercurial-devel mailing list