After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777849 - Incorrectly guessed encoding
Incorrectly guessed encoding
Status: RESOLVED INCOMPLETE
Product: meld
Classification: Other
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2017-01-27 18:17 UTC by banned
Modified: 2017-11-25 23:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot demonstrating the issue (312.34 KB, image/png)
2017-01-27 18:17 UTC, banned
Details

Description banned 2017-01-27 18:17:08 UTC
Created attachment 344436 [details]
screenshot demonstrating the issue

Here's a 3-way diff from meld (launched by TortoiseHG) after doing a merge with mercurial.

Note the complete mess on the left.
Comment 1 Kai Willadsen 2017-01-27 20:24:38 UTC
The left file has, for some reason, been decoded as (probably) UTF-16LE or similar.

You can work around this by setting the detect-encodings key to try whatever encoding the file is in first, e.g.,

gsettings set org.gnome.meld detect-encodings "['utf-8']"

(replacing 'utf-8' with whatever the encoding is). This just changes up the order of encodings that Meld uses to try to decode the text.

I'm going to mark this bug as a dup of bug 760311, since that's an existing feature request to allow manually selecting an encoding when things go wrong (as they have here).

Thanks for your bug report.

*** This bug has been marked as a duplicate of bug 760311 ***
Comment 2 banned 2017-01-27 20:36:17 UTC
> I'm going to mark this bug as a dup of bug 760311, since that's an existing 
> feature request to allow manually selecting an encoding when things go wrong
> (as they have here).

This should NOT be marked as a duplicate. One thing is the perfectly legitimate feature request to be able to manually force an encoding; a different thing is the BUG that leads to the WRONG automatic detection. The file was encoded in utf-8, as were the other two files which were decoded correctly.
Comment 3 Vasily Galkin 2017-02-06 16:14:29 UTC
What version of meld is on the screenshot?

The guessing behaviour was hugely changed starting with meld 3.15.2 due to porting to GTKSourceView helpers.

It has known guessing problem that fails distinguishing utf-8 from ascii-based single-byte-per-character encodings, but has NO known problems related to utf-16* encoding (like in screenshot), since they are very different from others.
Comment 4 Kai Willadsen 2017-11-25 23:01:46 UTC
Closing, since no more information has been provided.

Also, in current master, you can now manually switch encodings for situations like the above.