From: Alex Young Date: 2011-09-21T00:32:13+09:00 Subject: Re: StringIO and encodings Adam Prescott wrote in post #1022947: > On Tue, Sep 20, 2011 at 4:18 PM, Alex Young > wrote: > >> StringIO.new has no knowledge of the file encoding at the >> location it's called from. >> > > Can it not be changed so that it knows the internal encoding, instead? > That > would stop you having to break the argument-less constructor or doing > any > #dup'ing, no? I don't know if there's an API for that, but I suspect there isn't. If there were, then yes, that's the way to do it. -- Alex -- Posted via http://www.ruby-forum.com/.