CCed back to vim_use mailing list, and rearranged for proper bottom-posting
format. Please include the list on your response and bottom-post as I do below.

On Mon, Nov 12, 2012 at 11:13 AM, J S <[email protected]> wrote:
> 2012/11/12 Ben Fritz <[email protected]>
>>
>> On Monday, November 12, 2012 11:00:46 AM UTC-6, J S wrote:
>> > Hi vim users,
>> >
>> > I can't figure out a problem with utf-8 in (g)vim. I would like to use
>> > utf-8
>> > as encoding but the status line changes when I do that (set
>> > encoding=utf-8)
>> > and german Umlaute are not displayed correctly any more. There is some
>> > odd
>> > character representation shown, e.g. <e4> instead of ä.
>> >
>> > When I reencode to latin1 everything is back with Umlaut.
>> >
>>
>> Try setting 'encoding' in your .vimrc, at the very beginning, instead of
>> after
>> Vim starts up.
>>
>> [SNIP]
>>
>> My guess is that you are setting your statusline to text containing
>> non-ASCII
>> characters, then setting 'encoding', which causes Vim to reinterpret the
>> bytes
>> which are valid for Latin1 as UTF-8 without conversion.
>>
>
> I actually have that setting in my vimrc and only figured out that the
> encoding is the source of the problem after I commented out that statement.
> But I think you are right concerning the wrong reinterpretation of latin1
> bytes when converting to utf-8. I don't know where the status line text
> comes from otherwise I could change it to something not so sensitive to
> encoding.
>

WHERE in your .vimrc is it? It should be pretty much the very first line in the
file. You can put "set nocompatible" above it, but not much else. I suspect
wherever your statusline gets set happens before your set encoding=utf-8 line.

To find where your statusline is being set, try the following command:

  :verbose set statusline?

Also see the output of the :scriptnames command to see what might be getting
sourced beforehand.

What part of your statusline contains the ä character? Is it a filename or
something else? Another possible source of problems is if you specify the ä
character literally, like "set statusline=än\ example\ statusline". If you do
this, you'll need to tell Vim what the encoding of the file setting the
statusline is in, via the :scriptencoding command, prior to setting the
statusline.

-- 
You received this message from the "vim_use" 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

Reply via email to