Charles E Campbell Jr wrote:
A.J.Mechelynck wrote:
Guido Van Hoecke wrote:
[...]
However, when I open man output with vim or gvim, the rightmost quote
displays as a plain single quote (hex 27), the leftmost quote displays
as three characters, 'â' '<80>' and '<98>'. A word-splitting hyphen in
the rightmost column of lines is displayed as three characters: 'â'
'<80>' and '-' Apparently, Manpageviewer also reads this like that.
[...]
It looks like Vim does not recognise the file as being in UTF-8.
Hello, Tony!
Would a
g:manpageview_enc
option be a good idea? ie.
if exists("g:manpageview_enc")
exe "setlocal enc=".g:manpageview_enc
endif
somewhere after I open the buffer but before I read the manpage in.
I'm not too knowledgeable about encodings, I'm afraid.
Regards,
Chip Campbell
- 'encoding' is a global option; ":setlocal enc=<something>" is equivalent to
":set enc=<something>": it changes the 'encoding' (i.e., the internal
representation of characters) for all buffers and windows; but IIUC it doesn't
convert the currently loaded buffers to the new 'encoding'. The only "safe"
place to change that option is therefore in the vimrc, before loading
editfiles (according to ":help startup", buffers are opened, but not yet
loaded, before sourcing the vimrc).
- non-Unicode encodings don't include all Unicode codepoints, so there's no
guarantee that some character won't be displayed as some placeholder like ¿
- OTOH, Unicode includes all characters known to other encodings, so (if
'fileencodings' and 'termencodings' are set correctly) running with 'encoding'
set to UTF-8 should have no adverse effects, other than a very slight slowdown
due to conversion when reading or writing files.
Best regards,
Tony.