【发布时间】:2017-02-20 10:55:21
【问题描述】:
我正在使用 diff-match-patch (https://code.google.com/archive/p/google-diff-match-patch/) 来获取两个文本之间的差异。在 diff 结束时,它们返回奇怪的字符:例如 à 变为 %C3%A0、ù %C3%B9、" %22 等等。
这是我的代码示例:
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
如何找回原始字符?
【问题讨论】: