I attached patch for latest code. As required, now by default we compare the string by character. So it can handle multibyte character correctly. 'string-distance' has third optional parameter 'bytecompare' which use byte comparing instead of default character comparing. I did read this thread carefully and I did know different algorithms exist to calculate string distance. But I feel only my code is the right solution to our original problem. Our original problem is to provide a faster C solution to calculate *Levenshtein distance*. It will replace 3rd party Lisp solution like 'org-babel-edit-distance'. As 'org-babel-edit-distance' documented, it will "Return the edit (levenshtein) distance between strings S1 S2". So the problem here is to calculate *Levenshtein distance*. Other algorithms have their own definition of "string distance" so they are not for *Levenshtein distance*. Here is link of "Comparison of String Distance Algorithms": https://www.joyofdata.de/blog/comparison-of-string-distance-algorithms/