On Tue, May 15, 2012 at 10:50 AM, Christian Brabandt <[email protected]> wrote: > On Tue, May 15, 2012 17:20, Ben Fritz wrote: >> What if, right here, Vim were to check the buffer contents to see if all >> characters in the file can actually be converted to the new fenc setting, >> and issue a warning if not? It's not something Vim does currently...but I >> don't see why it couldn't. And I'd like to know if I do something stupid >> *when I do it*, not when I try to write the file and end up killing my >> file. > > That doesn't work, you could still afterwards enter glyphs in utf8, that > can't be converted into the fileencoding. >
This is true, but I'm more likely to remember not to enter glyphs which can't be encoded in the current fenc, than I am to know that these glyphs already exist in the buffer when changing the encoding. I think I'd still like to be warned when I change file encoding. Then again...since you point this out, it won't help in preventing the error that started this thread, if the "user does something" step is not to change file encoding, but rather to insert characters which cannot be encoded. I think the better idea is to do what your patch does, but only if 'writebackup' is disabled to prevent a slow-down when there is already an existing mechanism to prevent data loss. -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
