On Mon, Jan 14, 2019 at 5:16 AM Peng Yu <pengyu...@gmail.com> wrote:
>
> > This is the problematic setting. In Latin1 encoding, Vim can only
> > represent in its internal memory the 256 characters supported by
> > Latin1, and that dark triangle is not one of them. See at
> > https://vim.wikia.com/wiki/Working_with_Unicode (which my previous
> > post also mentioned) how to set up Vim so that it can handle any
> > Unicode codepoint.
>
> I download the vim source code and compiled it from scratch on the
> ubuntu docker container. But vim still does not recognize UTF-8
> characters.
>
> Why is it so? Shouldn't vim recognize UTF-8 characters out-of-the-box?

Yes and no. It's complicated to explain.
>
> I put the following code at the beginning of my viimrc. I don't see
> the problem solved either.
>
> if has("multi_byte")
>   if &termencoding == ""
>     let &termencoding = &encoding
>   endif
>   set encoding=utf-8
>   setglobal fileencoding=utf-8
>   "setglobal bomb
>   set fileencodings=ucs-bom,utf-8,latin1
> endif
>
> --
> Regards,
> Peng

Somewhere inside that outer if..endif block, add

        scriptencoding utf-8

and you might also add the following just before the "endif" line:ee

else
        echoerr "Error: Multi-byte not supported"

Then do
  :setlocal fenc?
in your vimrc, and if the answer is latin1, hit 8g8 to find any
illegal UTF-8 byte sequences, and if there is one, correct it, then
repeat until there are none left. Then :e to reload it, its
'fileencoding' should be utf-8. Edit it some more if you want. Then
restart Vim.


Best regards,
Tony.

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to