halffullheart / mdr

MDR Make Diffs Readable
GNU General Public License v3.0
21 stars 1 forks source link

Problem with accented characters #27

Open jlecour opened 10 years ago

jlecour commented 10 years ago

Hi,

Sometimes (often), I have a blank mdr window.

I took a few minutes to look into this and found that it's an issue with accented characters.

Here is a sample diff that will always produce a blank window :

diff --git file.rb file.rb
index 0123456..6543210 100644
--- file.rb
+++ file.rb
@@ -2,7 +2,7 @@
 line2
 line3
 line4
-old_line5 è
+new_line5 é
 line6
 line7
 line8

Strangely enough, if the accented letters are the same, it works.

halffullheart commented 10 years ago

I was able to reproduce this on the Mac version. I have not tested Linux or Windows yet. Probably an issue with all non ASCII characters.

madx commented 10 years ago

I confirm this happens on Linux too

halffullheart commented 10 years ago

MDR does not handle unicode characters correctly. It assumes 1 byte = 1 character. Noob mistake of mine back when I originally wrote this.