On 26/12/12 10:03, mattn wrote:
No, changing encoding occur refreshing. So It can't use char2nr gracefully.

The changing &encoding option affect to substitute(), strXXX or many another 
functions. The new feature I want is, getting character from utf-8 codepoint, Just 
it.


Well, if you set your 'encoding' to utf-8 once and for all in your vimrc (before any file is loaded), char2nr() will give you the Unicode codepoint number of the first character in its String argument. Similarly, nr2char() will give you (as a single character of one or more bytes) the Unicode codepoint corresponding to its integer argument.

I don't understand your sentence "it can't use char2nr gracefully". If 'encoding' is set to utf-8, you'll need some fancy footwork to get the character's value from the 'fileencoding' point-of-view if different, but it's possible via iconv().


Best regards,
Tony.
--
Indifference will be the downfall of mankind, but who cares?

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