vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] :map and unicode


From: Christopher Illies
Subject: Re: [vile] :map and unicode
Date: Mon, 17 Nov 2008 08:32:59 +0100
User-agent: Mutt/1.4.2.3i

On Sun, Nov 16, 2008 at 06:11:08PM -0500, Thomas Dickey wrote:
> On Thu, Nov 13, 2008 at 07:51:48PM +0100, Christopher Illies wrote:
> > I would like to map to a unicode character. For example "^Ks," should
> > become "ș" (unicode 0x219). For this I type: :map! ^V^Ks, ^Vu219 and
> > vile actually displays the ş character correctly, also when showing
> > all the mappings with :map!. But when I type ^Ks, in insert mode, some
> > asian charaters appear and not the expected ş.
> 
> I see _one_ problem (running in en_US.UTF-8 on Linux), which is easily
> fixed: vile is expecting the code to have 4 digits, e.g.,
> 
>       map! ^V^Ks, ^Vu0219
> 
> If there are fewer, it will prompt for the extra digits, and may not
> recover as one would like from an unexpected digit.
> 
> vile also treats the result differently depending on what the file-encoding
> of the current buffer is - it should be utf-8.
> 
> If you're seeing some additional problem, then it might depend on the
> platform (I've a FreeBSD-6...), or we're missing some detail such as
> the particular keystrokes following the ^Ks, sequence.
> 
> (let me know - thanks)

Here is an example of what happens:

Start a new file:
> vile test
In vile set the file encoding:
:set file-encoding utf-8
...then enter the first unicode character directly:
"i","^V","u","0","2","1","9","return","escape"
...enter the mapping:
":","m","a","p","!"," ","^V","^K","s",",","
","^V","u","0","2","1","9","return"
...enter the character as digraphs:
"i","^K","s",",","escape"
... exit vile with ":wq"


Now this is how the file looks like:
> cat test
ș
￈ル

> hexdump test
0000000 99c8 ef0a 88bf beef 0a99 000a          
000000b

The correct ş character entered when in input mode, but something
strange happens when going through the mapping, at least on my
system. As mentioned above, this is FreeBSD-7, locale is set to
"en_US.UTF-8".

Christopher





reply via email to

[Prev in Thread] Current Thread [Next in Thread]