From: KOSAKI Motohiro <kosaki.motohiro@gmail•com>
To: ruby-dev@ruby-lang.org (ruby developers list)
Subject: [ruby-dev:46375] Re: [ruby-trunk - Bug #2154][Assigned] filesystem encoding of UNIX
Date: Sat, 3 Nov 2012 04:56:59 +0900 [thread overview]
Message-ID: <CAHGf_=ofGUxRgu65j6zASE84gkMdQJa+_O_aLG0ciE4jZ8P9aQ@mail.gmail.com> (raw)
In-Reply-To: <20121102113203.128936EA62@zanzibar.garbagecollect.jp>
>> とくに指定しなければ、default external は locale から設定されるので、
>> 「UNIXにおけるfilesystem encodingはlocaleである」というのはそれほど
>> 変ではないのではないでしょうか。
>
> ふむ。
> とすると、本当は、filesystem encodingを明示して設定するAPIが
> 合ったほうがいいんでしょうかね。
> 2.0.0にも間に合わなわなさそうなので今は深入りを避けますが。
めんどくさいケースは以下の2つですかね。
1)
ロケールは UTF-8
ファイルシステムはFAT(よってファイルシステムのファイル名はShiftJIS or another country specific codepage)
ファイルの中身は EUC
※これはSDカードなどで実際に発生しうる
2) ロケールはUTF-8だけどファイルシステムエンコーディングはUTF8MACな某OS
というパターンだと思うので、これをケアする必要があるならAPIが必要そうに思えます。要望を上がってこない所をみるとあんまり困ってないのかな
まとまってないので思いついたことを箇条書きで書くと
・Linuxではlocale(UTF-8)、MacではUTF8MAC、WindowsではUTF-16(だっけ?)がデフォルトのファイルシステムエンコーディングであって欲しい
・SDカード対策のために違うエンコーディングを指定できて欲しい。これはdefault_externalをかえるよりかは引数で与えれたほうが便利そうな気がする。
default_externalを変えちゃうと別のスレッドがぎゃっといいそうだから
・default_filesystem_encondingみたいなのがあれば、昔のLinuxのイメージに残っているEUC-JPなデータをサルベージするときに便利そうである
・2.0ではデフォルトはlocaleにしておいたほうが、あとから自然に拡張できるような気がする
以上です。もうちょっと考えてからまたなんか書くかも
next prev parent reply other threads:[~2012-11-02 19:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-2154.20090928234343@ruby-lang.org>
2012-10-29 1:31 ` [ruby-dev:46309] [ruby-trunk - Bug #2154][Assigned] filesystem encoding of UNIX usa (Usaku NAKAMURA)
2012-10-29 1:57 ` [ruby-dev:46310] " Tanaka Akira
2012-11-02 11:32 ` [ruby-dev:46366] " U.Nakamura
2012-11-02 19:56 ` KOSAKI Motohiro [this message]
2012-11-02 20:17 ` [ruby-dev:46376] " Urabe Shyouhei
2012-11-03 0:00 ` [ruby-dev:46377] " KOSAKI Motohiro
2012-11-03 14:44 ` [ruby-dev:46386] " NARUSE, Yui
2012-11-05 6:13 ` [ruby-dev:46396] " U.Nakamura
2012-11-05 8:41 ` [ruby-dev:46398] " Hiroshi Shirosaki
2012-11-05 8:57 ` [ruby-dev:46399] " U.Nakamura
2012-11-05 12:33 ` [ruby-dev:46403] " Hiroshi Shirosaki
2012-11-05 12:53 ` [ruby-dev:46405] " U.Nakamura
2012-11-05 16:55 ` [ruby-dev:46408] " KOSAKI Motohiro
2012-11-09 10:00 ` [ruby-dev:46463] [ruby-trunk - Bug #2154] " naruse (Yui NARUSE)
2017-10-22 1:40 ` [ruby-dev:50300] [Ruby trunk Bug#2154] " mame
2017-10-28 17:34 ` [ruby-dev:50308] [Ruby trunk Bug#2154][Rejected] " naruse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHGf_=ofGUxRgu65j6zASE84gkMdQJa+_O_aLG0ciE4jZ8P9aQ@mail.gmail.com' \
--to=ruby-dev@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).