[Bug 5590] New: Change in encoding is not detected as a change by Mercurial

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Jun 8 04:14:08 EDT 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5590

            Bug ID: 5590
           Summary: Change in encoding is not detected as a change by
                    Mercurial
           Product: Mercurial
           Version: 4.2.1
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: lasse at lassekliemann.de
                CC: mercurial-devel at mercurial-scm.org

The following script demonstrates the problem. A file 'f' is created with a
single umlaut, then converted from the default UTF-8 to ISO-8859-1 (this step
should not be important) and then added and committed. Then the encoding is
changed from ISO-8859-1 to MacCentralEurope. The file *is* different as proven
by a comparison with the backup copy 'g'. However, neither 'hg st' nor 'hg
diff' nor 'hg ci' recognize any change. This is creating severe problems here,
and any help is very much appreciated. Thanks!

As far as I understand, Mercurial does not care about the encoding of file
content but just treats the file 'as is'. So the change in encoding should be
recognized as a change in the file.

$ hg init test.hg
$ cd test.hg
$ echo 'รค' > f
$ recode UTF-8..ISO-8859-1 f
$ file f
f: ISO-8859 text
$ hg add f
$ hg ci -m na
$ hg st
$ cp f g
$ recode ISO-8859-1..MacCentralEurope f
$ file f
f: Non-ISO extended-ASCII text
$ hg st
? g
$ hg diff
$ hg ci
nothing changed
$ cmp f g
f g differ: byte 1, line 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list