Excerpts from Jean-Philippe Bernardy's message of Sun Mar 22 18:43:37 +0100 2009: > > So far I've tried to follow the emacs model of text storage. > > The text is stored as the exact same byte sequence as on disk, > and is converted to characters "at the last moment". > > Advantages: > * opening a file followed by saving it is never going to corrupt a > file, even if the wrong encoding is chosen. > * changing encoding can be done after the file is open, again > without corruption of contents. (even though only utf8 is supported > atm) > > The big disadvantage is that accessing buffer contents by utf8 > offset is a bad interface, and adds much complexity, especially > when feeding contents to external libraries, for example: vty, gtk, > cocoa, regex-tdfa. > > I'm thinking to change the policy to this: select the encoding upon > opening/saving a file. > Internally all contents would be indexed by Characters. What would you > think of this > change?
I also think that this is a crucial choice to make. Moreover I tend to agree with you that this makes the code more complicated at a lot of places. So I'm in favor of this change. PS: have you looked at the text package [1] it may be of some help at some point. [1]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text -- Nicolas Pouillard --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list yi-devel@googlegroups.com http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---