vim: strange utf-8/latin1 interoperability problems

martin f krafft madduck at madduck.net
Thu Jan 26 11:28:34 CET 2006


Hi,

Sorry for cross-posting, but since I cannot figure out where the
problem lies, I think it's the best idea. Please respond to both
mailing list until it's clear that the error applies either to rxvt
or vim, not both.

I am using vim 6.4 (Debian 6.4-006+1) on an UTF-8 system with

  set termencoding=utf-8
  set fileencoding=utf-8
  set fileencodings=utf-8

The terminal is rxvt-unicode 7.0-1 (Debian). I am using the
"-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-iso10646-1" font,
and an en_GB.UTF-8 locale throughout.

I now have a latin1-encoded file to edit:

  lapse:~/debian_de/content> file intro.tex
  intro.tex: ISO-8859 text

The file uses a modline to set the encoding so that vim properly
displays it:

  lapse:~/debian_de/content> head -1 intro.tex
  % vim:encoding=latin1

This works most of the time, but it happened twice now that all
latin1-specific characters would be messed up and and displayed them
as two separate characters, reminiscent of the utf-8 representation.
For instance, 'ä' would become 'ä', which is rendered as separate
characters.

If I then set encoding=utf-8, the two characters change into one
character: <e4>. If, on the other hand, I set termencoding=latin1, it
all goes back to normal.

I think this is very strange because it only happens occasionally
but seems like a terminal window gone bad; I've deleted viminfo but
that did not do anything; so right now I have a terminal window open
which exhibits the problem, and a new one, where everything's fine.
What would you check to see how they differ? vim's configuration is
the same throughout, and the file is the same.

What is going on??? Thanks for any hints.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: madduck.bogus at madduck.net
 
micro$oft windoze: proof that p. t. barnum was correct.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
URL: <http://lists.schmorp.de/pipermail/rxvt-unicode/attachments/20060126/17f0872e/attachment.sig>


More information about the rxvt-unicode mailing list