{"action":"created","issue":{"url":"https://api.github.com/repos/vim-jp/issues/issues/615","repository_url":"https://api.github.com/repos/vim-jp/issues","labels_url":"https://api.github.com/repos/vim-jp/issues/issues/615/labels{/name}","comments_url":"https://api.github.com/repos/vim-jp/issues/issues/615/comments","events_url":"https://api.github.com/repos/vim-jp/issues/issues/615/events","html_url":"https://github.com/vim-jp/issues/issues/615","id":40994029,"number":615,"title":"プロセス置換ファイルオープン時のfileencodingsの振る舞いについて","user":{"login":"tac-et","id":1130799,"avatar_url":"https://avatars.githubusercontent.com/u/1130799?v=3","gravatar_id":"","url":"https://api.github.com/users/tac-et","html_url":"https://github.com/tac-et","followers_url":"https://api.github.com/users/tac-et/followers","following_url":"https://api.github.com/users/tac-et/following{/other_user}","gists_url":"https://api.github.com/users/tac-et/gists{/gist_id}","starred_url":"https://api.github.com/users/tac-et/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tac-et/subscriptions","organizations_url":"https://api.github.com/users/tac-et/orgs","repos_url":"https://api.github.com/users/tac-et/repos","events_url":"https://api.github.com/users/tac-et/events{/privacy}","received_events_url":"https://api.github.com/users/tac-et/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/question","name":"kind/question","color":"e10c02"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/status/patched","name":"status/patched","color":"e102d8"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/status/sent%20report","name":"status/sent report","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2014-08-24T03:19:01Z","updated_at":"2016-08-03T16:49:21Z","closed_at":null,"body":"初めまして。\r\n\r\nbash/zshのプロセス置換を利用してファイルを開くとき、\r\nfileencodingsの先頭の文字コードでiconvによる判定・変換エラーとなった場合？、\r\n2個目以降に妥当な文字コードを指定していても再判定は行われず、空のバッファが開きます。\r\n\r\n-\t手順  \r\n\t\r\n\t\t$ export LANG=ja_JP.utf8\r\n\t\t$ vim -u NONE --cmd \"set fileencodings=cp932,utf-8\" <(echo \"テスト\")\r\n-\t結果  \r\n\tバッファに文字列が何も表示されない状態でvimが起動する(ファイル自体は`/dev/fd/`配下のものを開いている)。\r\n-\t期待する結果  \r\n\tutf-8で開かれ、バッファに`テスト`と表示される。  \r\n-\t期待する結果が得られる例  \r\n\t-\t明示的にutf-8と指定  \r\n\t\t\r\n\t\t\t$ vim -u NONE --cmd \"e ++enc=utf-8\" --cmd \"set fileencodings=cp932,utf-8\" <(echo \"テスト\")\r\n\t-\t=()での一時ファイルを使った場合(zsh限定)  \r\n\t\t\r\n\t\t\t$ vim -u NONE --cmd \"set fileencodings=cp932,utf-8\" =(echo \"テスト\")\r\n\t-\t標準入力リダイレクト  \r\n\t\t\r\n\t\t\t$ echo \"テスト\" | vim -u NONE --cmd \"set fileencodings=cp932,utf-8\" -\r\n-\t確認環境  \r\n\t-\tvim 7.4.415 +iconv +multi_byte\r\n\t-\tCentOS6.5/bash, Mac OSX 10.9/zsh\r\n\r\nプロセス置換の仕組み上、妥当な振る舞いのようには思うのですが、\r\n直感的な挙動では無かったので、何か回避策など無いかと思い、チケットを起こしました。\r\n(`$ vimdiff -R <(grep foo fileA) <(grep foo fileB)`のような使い方が出来なかったので…)"},"comment":{"url":"https://api.github.com/repos/vim-jp/issues/issues/comments/237295406","html_url":"https://github.com/vim-jp/issues/issues/615#issuecomment-237295406","issue_url":"https://api.github.com/repos/vim-jp/issues/issues/615","id":237295406,"user":{"login":"k-takata","id":840186,"avatar_url":"https://avatars.githubusercontent.com/u/840186?v=3","gravatar_id":"","url":"https://api.github.com/users/k-takata","html_url":"https://github.com/k-takata","followers_url":"https://api.github.com/users/k-takata/followers","following_url":"https://api.github.com/users/k-takata/following{/other_user}","gists_url":"https://api.github.com/users/k-takata/gists{/gist_id}","starred_url":"https://api.github.com/users/k-takata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-takata/subscriptions","organizations_url":"https://api.github.com/users/k-takata/orgs","repos_url":"https://api.github.com/users/k-takata/repos","events_url":"https://api.github.com/users/k-takata/events{/privacy}","received_events_url":"https://api.github.com/users/k-takata/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T16:49:21Z","updated_at":"2016-08-03T16:49:21Z","body":"autocommand の挙動が心配だが、面倒でテストしていない。"}}
{"actor":{"display_login":"k-takata"}}