tags:

views:

31

answers:

1

I'm using diff-match-patch ( http://code.google.com/p/google-diff-match-patch/ ) to make difference between two text. At the end of the diff, they return strange characters: for example à become %C3%A0, ù %C3%B9, " %22 and so on.

This is an example of my code:

String startDocument = "hello world";
String endDocument = "àèìòù\"";
diff_match_patch dmp = new diff_match_patch();
dmp.Diff_Timeout = 16;
LinkedList<Diff> diffs = dmp.diff_main( startDocument, endDocument );
String diff = dmp.diff_toDelta(diffs);
System.out.println(diff);      //return: -11 +%C3%A0%C3%A8%C3%AC%C3%B2%C3%B9%22

How can I retrieve the original characters?

A: 

Try

javac -encoding utf8 DaClass.java

and

java -Dfile.encoding=utf8 DaClass
Kai
The other characters manipulated in the class aren't wrong, only the diff function return this strange characters...
Gabriele