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?

Cheers,
JP.

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to