On Thu, Feb 10, 2011 at 4:35 AM, Tony Mechelynck
<[email protected]> wrote:
>
> IIUC, when 'encoding' is "utf-8" and you are entering characters as hex, you
> would have to type E4B880, not 4E00, for the Chinese horizontal-bar number
> one (一 U+4E00, one character, three bytes), and F0A08480, not 20100 or
> 00020100, for the "additional Chinese character" 𠄀 (U+20100, one character,
> four bytes)? Similarly for *any* character above U+007F when 'encoding' is
> set to "utf-8"? For instance, E9 when 'encoding' is latin1, but C3A9 when it
> is utf-8, for the lowercase e-acute, é, U+00E9, the most frequent accented
> letter in the French language? But see also :help i_CTRL-V_digit.
>
>
> Best regards,
> Tony.

For hex insertion I'm thinking of a script. That would be easier as
using i_CTRL-V_digit for every character. The script would only need
to map [0-9a-zA-Z] to be able to capture the hex input and convert it
to single characters. The script could probably solve the encoding
problems.

As for encoding itself, I think it still posses a problem for my
current 'displaymode' patches. I looked at the documentation bit I
didn't dig into it. I see there are quite a few encoding settings. For
now I disable the encoding routines when displaying text and either
'hex' or 'dot', this was a fast hack and I wonder if it even works
correct. I think it is better to disable encoding entirely when hex
editing but I didn't look deep enough into the encoding settings. An
alternative would be to allow encoding but document that there might
be unexpected (but technically correct) output. The same as the tab
character is still shown as a normal tab in 'hex' mode, 'list' needs
to be set and 'listchars' shouldn't contain tab, for a tab to be
displayed as hex.

Suggestions on how encoding should be shown in 'hex' and 'dot' mode
are welcome. Consider multi byte characters which can take up either 1
or 2 display cells.

Regards,
Peter

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

Raspunde prin e-mail lui