On Wed, 24 Sep 2008 21:02:14 +1000, Martin Duerst <duerst / it.aoyama.ac.jp>  
wrote:

> Well, that's the deadline for feature changes for 1.9.1.
> It would be a real pity to wait for 2.0 for this.
> The feature freeze wiki at
> http://redmine.ruby-lang.org/wiki/ruby/DevelopersMeeting20080922
> says that default_internal is currently pending, but that
> this should be discussed/settled this week.

Sorry, I am new here, so I didn't know about that URL, nor about the  
release procedures, nor did I know whether one of the other developers was  
working on this. In my previous post I asked whether I should proceed, but  
got no reply. I didn't think it was worthwhile my spending time on it if  
someone else has done it, or almost has.

> Anyhow, I had a look at the code, and it doesn't seem to be that
> difficult. The function io_extract_encoding_option in io.c
> seems to be central. I'm attaching a patch, which I hope is
> a good start. I'm also writing to ruby-dev (in Japanese)
> because that's where the real experts are.
> The patch isn't as strict as your proposal with respect
> to re-setting, but I'm fine either way.
>
> I have tested this patch with code like the following
> (called with -Eutf-8, -Eshift_jis, -Eeuc-jp, and without -E
> option, in all combinations)

I am not sure if your patch also works correctly with IO#set_encoding.  
This is absolutely necessary for HTTP data to be transcoded correctly in  
OpenURI, for example. Please see my previous post. That post also suggests  
NOT implementing default_internal=, but rather extending the -E command  
line flag to be -E "ext:int", and if not defined there to use the "source  
encoding".

I guess your patch may "get the feature in" by the required date, but I  
feel that it may require a little more thought to get it right.

Regards
Mike