Beta release: use of 'fencoding' in TOhtml

2 views
Skip to first unread message

Benjamin Fritz

unread,
Oct 7, 2010, 1:39:34 AM10/7/10
to vim_dev, vim_use
A while back on vim_dev, there was a suggestion for TOhtml to use the
'fencoding' of the source buffer for the HTML encoding of the
generated file.

This thread discusses it, and I eventually included an initial beta
version that does exactly this:

http://groups.google.com/group/vim_dev/browse_thread/thread/c41f797237e46f45

Also included is detection of the proper 'fileencoding' from the
user-specified HTML encoding, if given.

I have not received any feedback on the initial release, but I have
acted on my musings and created a second beta version that removes
specific encodings from the automatic detection, which are not
supported on all 5 major browsers, according to
http://wiki.whatwg.org/wiki/Web_Encodings.

Please try it out and send me any comments! See attached patch against
the current latest Vim (Mercurial changeset fae782ef63dd), or go to
http://code.google.com/p/vim-2html-test/downloads/list for the fully
patched files. Most users should not notice any differences, unless
they had specific encoding-related problems in the past, in which case
hopefully the updates solve more problems than they create.

One thing in particular I'd like to know, is it worthwhile to provide
platform-specific code, that adds additional encodings based on your
system? For example, Windows users might like windows-1252 detected
automatically by default. Is there a good way to figure out what the
supported encodings are for a given system? Maybe, code like this
would be better as a separately distributed plugin, since most users
can probably just use UTF-8 with no problems.

2html_v7b2_fenc.patch

Benjamin Fritz

unread,
Oct 8, 2010, 10:13:27 PM10/8/10
to vim_dev, vim_use

Oops, found one bug, where converting to UTF-8 for all Unicode
encodings did not also convert the fencoding.

Here's an updated patch. New fully-patched files also have been
uploaded as indicated above.

I'll probably give it about another week to collect comments before
submitting to Bram if there are no issues.

2html_v7b3_fenc.patch

Benjamin Fritz

unread,
Oct 17, 2010, 10:32:49 PM10/17/10
to vim_dev, vim_use

I haven't received any comments yet. Has anyone had a chance to try
this, or at least look at the :help updates for usability, usefulness,
and/or correctness?

Benjamin Fritz

unread,
Oct 27, 2010, 12:26:22 PM10/27/10
to Bram Moolenaar, vim_dev
On Wed, Oct 27, 2010 at 10:11 AM, Bram Moolenaar <Br...@moolenaar.net> wrote:
>
> Benjamin -
>
> Is it ready to be included now?  If so, can you send me all the changed
> files?
>
> - Bram
>

I still have not received any comments, but I think it is ready. I am
currently working on a separate plugin to submit to vim.org which uses
the new options to automatically add all the installed codepages on
Windows to the auto-detection. I was going to use this for a further
test, but I have already updated my test suite and ran it on the new
code with good results. I will send you the updated files either
tonight or tomorrow night.

The extra plugin I'm making to add Windows codepages might be very
useful to any Windows users who use TOhtml a lot with uncommon
encodings. Do you think the plugin should be mentioned in the :help?

I also wanted to make a plugin for Unix systems, but iconv --list
apparently returns results in a "system-dependent format". Is there a
good way to get all available encodings on a Unix system? On Windows
I'm doing a glob() for c_*.nls files in the System32 directory.

Reply all
Reply to author
Forward
0 new messages