Ken Takata wrote:
> When process substitution (e.g. "<(cmd)") is used on bash (or zsh), file
> encoding detection doesn't work, and an empty buffer is opened.
> E.g.:
>
> $ vim -u NONE --cmd "set fencs=cp932,utf-8" <(echo テスト)
> # Assuming the system encoding is utf-8.
>
> Vim will be executed with the command line like:
>
> $ vim -u NONE --cmd "set fencs=cp932,utf-8" /dev/fd/63
>
> "/dev/fd/63" is a fifo and it is not seekable.
> The echoed string "テスト" (utf-8) cannot be converted from cp932 to utf-8, so
> Vim retries with utf-8, but it fails because the input is not seekable.
>
> However reading from stdin can detect the encoding. E.g.:
>
> $ echo テスト | vim -u NONE --cmd "set fencs=cp932,utf-8" -
>
> I think file encoding detection should also work with process substitution.
> Attached patch fixes the problem.
Thanks. It would be good to have a test for this. The encoding
detection is important, but I don't think there is a test for it.
Reading from stdin and fifo require starting Vim. Test49 does this, it
just uses ../vim for that. That doesn't work on Windows though. But
the fifo won't work on Windows either.
--
Mrs Abbott: I'm a paediatrician.
Basil: Feet?
Mrs Abbott: Children.
Sybil: Oh, Basil!
Basil: Well, children have feet, don't they? That's how they move
around, my dear. You must take a look next time, it's most
interesting. (Fawlty Towers)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.