Charles Campbell wrote:
> Christian Brabandt wrote:
>> Hi Charles!
>>
>> On Fr, 27 Mär 2015, Charles Campbell wrote:
>>
>>> Bram Moolenaar wrote:
>>>> Charles Campbell wrote:
>>>>
>>>>> I tried a directory named "josé" and found that netrw wasn't handling it
>>>>> well.  One of the reasons is expand("%"), which is used to get the full
>>>>> path.  However, when in that directory, expand("%") shows
>>>>> /home/cec/joe<e9> instead of the desired /home/cec/josé .  Do I need to
>>>>> program around this or is this problem a bug with expand()?
>>>> I don't see this problem.  What is 'encoding' set to?
>>>>
>>> enc is utf-8.  By bisection of my .vimrc, I find that the following is
>>> enough in a .vimrc to cause the <e9> to appear instead of é
>>>
>>>
>>> set nocp
>>> filetype plugin on
>>> set enc=utf-8
>> In what filetype did you execute the expand() call?
>>
> The filetype: netrw
>
> Try having a directory called josé with a file therein called "one".
>
> vim -u (whatever you called the vimrc above)
> :echo expand("%:p")
>
> You'll see something like /home/cec/jos<e9>/one
>
> With this, there's no filetype involved.
>
Hello!

I've attached a small tarball illustrating the problem I'm having with
expand().

gunzip jose.tar.gz
tar xf jose.tar
cd josé
vi junk.vim
:so %
:echo x[4]
:echo y[4]

With the first echo, you'll see (using utf-8 for encoding)  <e9>.  This
is the hex code for a é.  The second echo shows <c3>. 

:echo x

shows /jos<e9>/junk.vim

:echo y

shows /josé/junk.vim

This problem has some definitely unwanted effects.  At least one person
redid their home directory's name to avoid the accent, because netrw
won't display it correctly (or use it correctly) because of this bug.

Regards,
Chip Campbell

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

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

Attachment: jose.tar.gz
Description: GNU Zip compressed data

Raspunde prin e-mail lui