[前][次][番号順一覧][スレッド一覧]

ruby-changes:18211

From: drbrain <ko1@a...>
Date: Fri, 17 Dec 2010 04:21:45 +0900 (JST)
Subject: [ruby-changes:18211] Ruby:r30232 (trunk): Alter comment on String#encode for better wording and ri output

drbrain	2010-12-17 04:20:51 +0900 (Fri, 17 Dec 2010)

  New Revision: 30232

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30232

  Log:
    Alter comment on String#encode for better wording and ri output

  Modified files:
    trunk/ChangeLog
    trunk/transcode.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30231)
+++ ChangeLog	(revision 30232)
@@ -1,3 +1,8 @@
+Fri Dec 17 04:18:37 2010  Eric Hodel  <drbrain@s...>
+
+	* transcode.c (str_encode): Alter comment for better wording and ri
+	  output.
+
 Fri Dec 17 00:05:40 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* io.c (rb_io_advise): New API. IO#advise() allows to tell the
Index: transcode.c
===================================================================
--- transcode.c	(revision 30231)
+++ transcode.c	(revision 30232)
@@ -2763,46 +2763,46 @@
  *     str.encode(dst_encoding, src_encoding [, options] )   -> str
  *     str.encode([options])   -> str
  *
- *  The first form returns a copy of <i>str</i> transcoded
+ *  The first form returns a copy of +str+ transcoded
  *  to encoding +encoding+.
- *  The second form returns a copy of <i>str</i> transcoded
+ *  The second form returns a copy of +str+ transcoded
  *  from src_encoding to dst_encoding.
- *  The last form returns a copy of <i>str</i> transcoded to
- *  <code>Encoding.default_internal</code>.
+ *  The last form returns a copy of +str+ transcoded to
+ *  <tt>Encoding.default_internal</tt>.
+ *
  *  By default, the first and second form raise
  *  Encoding::UndefinedConversionError for characters that are
  *  undefined in the destination encoding, and
  *  Encoding::InvalidByteSequenceError for invalid byte sequences
  *  in the source encoding. The last form by default does not raise
  *  exceptions but uses replacement strings.
- *  The <code>options</code> Hash gives details for conversion.
  *
- *  === options
- *  The hash <code>options</code> can have the following keys:
+ *  The +options+ Hash gives details for conversion and can have the following
+ *  keys:
+ *
  *  :invalid ::
- *    If the value is <code>:replace</code>, <code>#encode</code> replaces
- *    invalid byte sequences in <code>str</code> with the replacement character.
- *    The default is to raise the exception
+ *    If the value is +:replace+, #encode replaces invalid byte sequences in
+ *    +str+ with the replacement character.  The default is to raise the
+ *    Encoding::InvalidByteSequenceError exception
  *  :undef ::
- *    If the value is <code>:replace</code>, <code>#encode</code> replaces
- *    characters which are undefined in the destination encoding with
- *    the replacement character.
+ *    If the value is +:replace+, #encode replaces characters which are
+ *    undefined in the destination encoding with the replacement character.
+ *    The default is to raise the Encoding::UndefinedConversionError.
  *  :replace ::
- *    Sets the replacement string to the value. The default replacement
+ *    Sets the replacement string to the given value. The default replacement
  *    string is "\uFFFD" for Unicode encoding forms, and "?" otherwise.
  *  :fallback ::
- *    Sets the replacement string by the hash for undefined character.
- *    Its key is a such undefined character encoded in source encoding
+ *    Sets the replacement string by the given hash for undefined character.
+ *    Its key is an undefined character encoded in the source encoding
  *    of current transcoder. Its value can be any encoding until it
  *    can be converted into the destination encoding of the transcoder.
  *  :xml ::
- *    The value must be <code>:text</code> or <code>:attr</code>.
- *    If the value is <code>:text</code> <code>#encode</code> replaces
- *    undefined characters with their (upper-case hexadecimal) numeric
- *    character references. '&', '<', and '>' are converted to "&amp;",
- *    "&lt;", and "&gt;", respectively.
- *    If the value is <code>:attr</code>, <code>#encode</code> also quotes
- *    the replacement result (using '"'), and replaces '"' with "&quot;".
+ *    The value must be +:text+ or +:attr+.
+ *    If the value is +:text+ #encode replaces undefined characters with their
+ *    (upper-case hexadecimal) numeric character references. '&', '<', and '>'
+ *    are converted to "&amp;", "&lt;", and "&gt;", respectively.
+ *    If the value is +:attr+, #encode also quotes the replacement result
+ *    (using '"'), and replaces '"' with "&quot;".
  *  :cr_newline ::
  *    Replaces LF ("\n") with CR ("\r") if value is true.
  *  :crlf_newline ::

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]