Re: Manpageviewer problem

2006-12-08 Thread Guido Van Hoecke

Hi,

Charles E Campbell Jr said on 12/07/2006 02:51 PM:
 Guido Van Hoecke wrote:

 Hi,

 I recently started using Dr.Chips Manpageviewer
 http://vim.sourceforge.net/scripts/script.php?script_id=489
 http://mysite.verizon.net/astronaut/vim/vbafiles/manpageview.vba.gz

 There's one problem, though. It has problems to display certain
 characters (in vim as well as gvim, on ubuntu 6.10) and displays their
 hex code, such as: 80, 8098, 89 ...

 Is this something about my setup? There's no problem with viewing the
 affected man pages in a gnome-terminal, nor with the default man.vim man
 page viewer.

 I already mentionned this problem in another thread, but it probably got
 lost in it.

 Any help would be appreciated. I like this Manpageviewer, a.o. for its
 optimised use of screen real estate. But this little display hickup is a
 nuisance.

 Please try some of the suggestions mentioned with g:manpageview_options
 (see  :help manpageview_options  ).

I now know that this is not a Manpageviewer problem, but some mixup with
my locale and vim in general. Sorry for the wrong attribution.

I have selected 'English (United States of America)' as default language
thru the System - Administration - Language Support menu (Ubuntu
6.10). This generates following lines in /etc/environment:

LANG=en_US.UTF-8
LANGUAGE=en_US:en

This setting causes man to use curly and ‘ and ’. These quotes
display without problems in terminal sessions as well as in gvim, which
I am now using to prepare the body of this message.

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.

Still, I do not understand this. I can paste these quote characters in
vim and when I 'ga' them it shows:
8216 x2018 octal 20030 and
8217 x2019 octal 20031.

So how come it is a problem to get read these from man output? And how
can I fix this?

Just checked how gedit displays this man output, and it also shows these
multibyte characters in a funny way. So it is not even a vim problem.
I'll have to study further to understand and solve this problem.

TIA for any help and/or suggestions.

Guido.


 Regards,
 Chip Campbell




--
http://vanhoecke.org ... and go2 places!


Re: Manpageviewer problem

2006-12-08 Thread A.J.Mechelynck

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.

Add to your vimrc (you can use cut-and-paste):

 enable Unicode support if possible
if has('multi_byte')
if encoding !~? '^u'
if termencoding == ''
let termencoding = encoding
endif
set encoding=utf-8
endif
set fencs-=ucs-bom
set fencs-=utf-8
set fencs^=ucs-bom,utf-8
else
echoerr 'Error: Multi-byte support not compiled-in'
endif

This ought to fix it. If you get the error message, it means you need a 
different binary, with +multi_byte (or +multi_byte_ime) compiled-in.



Best regards,
Tony.


Re: Manpageviewer problem

2006-12-08 Thread Guido Van Hoecke

Tony,

A.J.Mechelynck said on 12/08/2006 02:40 PM:
 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.

 Add to your vimrc (you can use cut-and-paste):

  enable Unicode support if possible
 if has('multi_byte')
 if encoding !~? '^u'
 if termencoding == ''
 let termencoding = encoding
 endif
 set encoding=utf-8
 endif
 set fencs-=ucs-bom
 set fencs-=utf-8
 set fencs^=ucs-bom,utf-8
 else
 echoerr 'Error: Multi-byte support not compiled-in'
 endif

 This ought to fix it. If you get the error message, it means you need a
 different binary, with +multi_byte (or +multi_byte_ime) compiled-in.


Thank you for yoour help, but I am afraid that this patch would not
modify my environment. My vim has mult-byte support and these options
already have following values:

enc=utf-8
tenc=
fencs=ucs-bom,utf-8,default,latin1

Any other ideas?

Kind regards,

Guido

--
http://vanhoecke.org ... and go2 places!


Re: Manpageviewer problem

2006-12-08 Thread A.J.Mechelynck

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.


Manpageviewer problem

2006-12-07 Thread Guido Van Hoecke

Hi,

I recently started using Dr.Chips Manpageviewer
http://vim.sourceforge.net/scripts/script.php?script_id=489
http://mysite.verizon.net/astronaut/vim/vbafiles/manpageview.vba.gz

There's one problem, though. It has problems to display certain
characters (in vim as well as gvim, on ubuntu 6.10) and displays their
hex code, such as: 80, 8098, 89 ...

Is this something about my setup? There's no problem with viewing the
affected man pages in a gnome-terminal, nor with the default man.vim man
page viewer.

I already mentionned this problem in another thread, but it probably got
lost in it.

Any help would be appreciated. I like this Manpageviewer, a.o. for its
optimised use of screen real estate. But this little display hickup is a
nuisance.

Guido.

--
http://vanhoecke.org ... and go2 places!


Re: Manpageviewer problem

2006-12-07 Thread Charles E Campbell Jr

Guido Van Hoecke wrote:


Hi,

I recently started using Dr.Chips Manpageviewer
http://vim.sourceforge.net/scripts/script.php?script_id=489
http://mysite.verizon.net/astronaut/vim/vbafiles/manpageview.vba.gz

There's one problem, though. It has problems to display certain
characters (in vim as well as gvim, on ubuntu 6.10) and displays their
hex code, such as: 80, 8098, 89 ...

Is this something about my setup? There's no problem with viewing the
affected man pages in a gnome-terminal, nor with the default man.vim man
page viewer.

I already mentionned this problem in another thread, but it probably got
lost in it.

Any help would be appreciated. I like this Manpageviewer, a.o. for its
optimised use of screen real estate. But this little display hickup is a
nuisance.


Please try some of the suggestions mentioned with g:manpageview_options
(see  :help manpageview_options  ).

Regards,
Chip Campbell