From 5677106ec905122398b330593fd9ec72df3a074e Mon Sep 17 00:00:00 2001 From: yugui Date: Tue, 23 Dec 2008 11:30:44 +0000 Subject: * io.c: rdoc for File::open and 1.9 feature in file modes. * transcode.c: rdoc for String#encode git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index cfb11bf34d..f40666535b 100644 --- a/transcode.c +++ b/transcode.c @@ -2566,10 +2566,33 @@ str_encode_bang(int argc, VALUE *argv, VALUE str) * to encoding +encoding+. * The second form returns a copy of str transcoded * from src_encoding to dst_encoding. - * The options Hash gives details for conversion. Details - * to be added. + * The options Hash gives details for conversion. * The last form returns a copy of str transcoded to * Encoding.default_internal. + * + * === options + * A hash options can have the following keys: + * :invalid :: + * If the value is :replace #encode replaces + * invalid characters in str with the replacement character. + * :undef :: + * If the value is :replace #encode replaces + * characters which are undefined in the destination character set with + * the replacement character. + * :replace :: + * sets the replacement character to the value. + * :xml :: + * The value must be :text or :attr. + * If the value is :text #encode replaces + * undefined characters with its numerical character reference. + * If the value is :attr #encode also quotes + * the replacement result. + * :cr_newline :: + * replaces EOL with CR. + * :crlf_newline :: + * replaces EOL with CR LF. + * :universal_newline :: + * replaces EOL with LF. */ static VALUE -- cgit v1.2.3