Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Non-homogenous encoding in Mercurial causes merge problems using kdiff3

Martin Vajsar
Posts: 3752
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a Mercurial repository that contains a few Java projects, a C project and a bunch of SQL/configuration files. Unfortunately, these files are stored in different encoding - UTF-8 for Java projects and windows-1250 for everything else. I'm using TortoiseHg and kdiff3 to merge branches. I've found that during some merges the national characters in windows-1250 files got garbled.

The last merge which garbled some files happened some time ago, and I may be using different Regional Settings in kdiff3 now. Currently I've set the encoding to windows-1250 and checked the box to automatically recognize Unicode. However, if I use kdiff3 to diff a UTF-8 file which does contain national characters, the UTF-8 encoding is not recognized and national characters in the file are garbled. (This does not mean that a merge process would result to a garbled file, of course, it just means that kdiff3 didn't detect the file is in UTF-8.)

Is it possible to safely use kdiff3 in this situation? If not, is there another diff/merge tool which would handle multiple encodings more gracefully (I could specify encodings by top-level repository folder)?

Of course, I could unify the encodings (probably converting Java projects to windows-1250), though I'd rather explore other options first.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic