From: Paul Battley Date: 2006-10-17T17:58:58+09:00 Subject: Re: Edit Distance at Wikipedia On 17/10/06, Dido Sevilla wrote: > The code makes that assumption, correct or not. If you're one of those > ignorant yokels who believes that characters are bytes, it's also a > safe assumption. ;) Now, if you're one of those people who does i18n, > l10n, and m17n before breakfast, you'll have alarm bells going off > inside your head immediately, as such assumptions are in general very > dangerous to make. A cardinal rule in this kind of programming is that > strings are meaningless without an attached encoding. The version of Levenshtein in the Text project (http://rubyforge.org/projects/text) will work on either UTF-8 codepoints or bytes depending on the value of $KCODE. It's the best we can do for now; in the future, of course, we will be able to decide based on the strings' encodings themselves. Paul.