On Aug 25, 11:11 pm, JiaYanwei <[email protected]> wrote: > I think this will be more reasonable than before. > > If the encoding of edited text file differ form the system/vim encoding, it's > inconvenient to set default HTML charset to be 'encoding'. Thus, after > ':TOhtml', we should modify the generated HTML file to make the file encoding > the same as HTML charset. > > e.g. If the system/vim encoding is 'UTF-8', but a text file encoding is > 'latin-1'. If the default HTML charset is 'encoding', after ':TOhtml', we > should change the HTML charset to 'iso-8859-1', or save the generated HTML > file by ':w ++enc=utf-8'. But if the default HTML charset is 'fileencoding', > we should do nothing after ':TOhtml'. >
Thanks, I'll take a look. I don't yet have a good handle on 'encoding', 'fileencoding', and any other related options. It looks like I'm going to need to. >From my understanding, 'fileencoding' is the encoding Vim is supposed to use to read/write the file. So, it does make sense that we should use this instead of just 'encoding' for the charset of the generated html. Does anyone know why TOhtml has used 'encoding' instead? I have not touched the charset detection code yet, other than to move it from the 2html.vim file into the autoload/tohtml.vim file. You say you need to do nothing to the TOhtml output if we set the charset to the file encoding. But, don't we also need to ensure that the file encoding of the new html file is the same as the file encoding of the source file? The file encoding could be different from file to file, whereas Vim's encoding is always the same. I can picture this causing problems, if the charset says one thing, but the file encoding is different. By the way, until this is fixed...you can use the g:html_use_encoding option to override the normal detection mechanisms, rather than manually editing the generated HTML file. -- You received this message from the "vim_dev" 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
