2011/4/27 nobu <ko1 / atdot.net>:
> nobu    2011-04-27 00:52:35 +0900 (Wed, 27 Apr 2011)
>
>  New Revision: 31353
>
>  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31353
>
>  Log:
>    * transcode.c (econv_init): fix rdoc.
>
>  Modified files:
>    trunk/transcode.c
>
> Index: transcode.c
> ===================================================================
> --- transcode.c (revision 31352)
> +++ transcode.c (revision 31353)
> @@ -3211,8 +3211,8 @@
>  *     :undef => :replace         # replace undefined conversion
>  *     :replace => string         # replacement string ("?" or "\uFFFD" if not specified)
>  *     :universal_newline => true # decorator for converting CRLF and CR to LF
> - *     :crlf_newline => true      # decorator for converting LF to CRLF
> - *     :cr_newline => true        # decorator for converting LF to CR
> + *     :crlf_newline => true      # decorator for converting CRLF to LF
> + *     :cr_newline => true        # decorator for converting CR to LF
>  *     :xml => :text              # escape as XML CharData.
>  *     :xml => :attr              # escape as XML AttValue
>  *   integer form:

気がついたんですが、この変更って変じゃないですかね。

以下のように、:crlf_newline => true とすると、
\r\n は \r\r\n となることからわかるように、
もとの記述の LF to CRLF のほうが正しいんじゃないでしょうか。

% ./ruby -e '
ec = Encoding::Converter.new("EUC-JP", "Shift_JIS", :crlf_newline=>true)
p ec.convert("\r\n")
p ec.finish
'
"\r\r\n"
""

-- 
[田中 哲][たなか あきら][Tanaka Akira]