update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c2204972b
commit
8702c4d0d7
@ -1010,7 +1010,7 @@ Init_Encoding(void)
|
|||||||
|
|
||||||
rb_enc_replicate("Windows-31J", rb_enc_from_index(ENCINDEX_SJIS));
|
rb_enc_replicate("Windows-31J", rb_enc_from_index(ENCINDEX_SJIS));
|
||||||
rb_enc_alias("CP932", "Windows-31J");
|
rb_enc_alias("CP932", "Windows-31J");
|
||||||
rb_enc_alias("csWindows31J", "Windows-31J"); /* IANA. IE6 accepts csWindows31J but Windows-31J. */
|
rb_enc_alias("csWindows31J", "Windows-31J"); /* IANA. IE6 don't accept Windows-31J but csWindows31J. */
|
||||||
|
|
||||||
for (i = 0; i < enc_table_size; ++i) {
|
for (i = 0; i < enc_table_size; ++i) {
|
||||||
rb_encoding *enc = enc_table[i].enc;
|
rb_encoding *enc = enc_table[i].enc;
|
||||||
|
68
io.c
68
io.c
@ -3873,33 +3873,39 @@ rb_io_s_sysopen(int argc, VALUE *argv)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* open(path [, mode [, perm]] ) => io or nil
|
* open(path [, mode_enc [, perm]] ) => io or nil
|
||||||
* open(path [, mode [, perm]] ) {|io| block } => obj
|
* open(path [, mode_enc [, perm]] ) {|io| block } => obj
|
||||||
*
|
*
|
||||||
* Creates an <code>IO</code> object connected to the given stream,
|
* Creates an <code>IO</code> object connected to the given stream,
|
||||||
* file, or subprocess.
|
* file, or subprocess.
|
||||||
*
|
*
|
||||||
* If <i>path</i> does not start with a pipe character
|
* If <i>path</i> does not start with a pipe character
|
||||||
* (``<code>|</code>''), treat it as the name of a file to open using
|
* (``<code>|</code>''), treat it as the name of a file to open using
|
||||||
* the specified mode (defaulting to ``<code>r</code>''). The mode is
|
* the specified mode (defaulting to ``<code>r</code>'').
|
||||||
|
*
|
||||||
|
* The mode_enc is
|
||||||
* either a string or an integer. If it is an integer, it must be
|
* either a string or an integer. If it is an integer, it must be
|
||||||
* bitwise-or of open(2) flags, such as File::RDWR or File::EXCL.
|
* bitwise-or of open(2) flags, such as File::RDWR or File::EXCL.
|
||||||
* If it is a string, it is either "mode", "mode:encoding", or
|
* If it is a string, it is either "mode", "mode:ext_enc", or
|
||||||
* "mode:encoding:encoding". "mode" is one of the following:
|
* "mode:ext_enc:int_enc".
|
||||||
|
* The mode is one of the following:
|
||||||
*
|
*
|
||||||
* r: read (default)
|
* r: read (default)
|
||||||
* w: write
|
* w: write
|
||||||
* a: append
|
* a: append
|
||||||
*
|
*
|
||||||
* The mode can be followed by "b" (means binary-mode), or "+"
|
* The mode can be followed by "b" (means binary-mode), or "+"
|
||||||
* (means both reading and writing allowed) or both. If one
|
* (means both reading and writing allowed) or both.
|
||||||
* encoding is specified, read string will be tagged by the
|
* If ext_enc (external encoding) is specified,
|
||||||
* encoding in reading, and output string will be converted
|
* read string will be tagged by the encoding in reading,
|
||||||
* to the specified encoding in writing. If two encoding names
|
* and output string will be converted
|
||||||
* are specified, the read string is converted from the former
|
* to the specified encoding in writing.
|
||||||
* encoding to the latter encoding then tagged with the latter
|
* If two encoding names,
|
||||||
* in read mode, and in write mode, the output string will be
|
* ext_enc and int_enc (external encoding and internal encoding),
|
||||||
* converted from the latter to the former before writing.
|
* are specified, the read string is converted from ext_enc
|
||||||
|
* to int_enc then tagged with the int_enc in read mode,
|
||||||
|
* and in write mode, the output string will be
|
||||||
|
* converted from int_enc to ext_enc before writing.
|
||||||
*
|
*
|
||||||
* If a file is being created, its initial permissions may be
|
* If a file is being created, its initial permissions may be
|
||||||
* set using the integer third parameter.
|
* set using the integer third parameter.
|
||||||
@ -5640,22 +5646,25 @@ io_encoding_set(rb_io_t *fptr, int argc, VALUE v1, VALUE v2)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* IO.pipe -> array
|
* IO.pipe -> [read_io, write_io]
|
||||||
* IO.pipe(encoding) -> array
|
* IO.pipe(ext_enc) -> [read_io, write_io]
|
||||||
* IO.pipe(encoding1, encoding2) -> array
|
* IO.pipe("ext_enc:int_enc") -> [read_io, write_io]
|
||||||
|
* IO.pipe(ext_enc, int_enc) -> [read_io, write_io]
|
||||||
*
|
*
|
||||||
* Creates a pair of pipe endpoints (connected to each other) and
|
* Creates a pair of pipe endpoints (connected to each other) and
|
||||||
* returns them as a two-element array of <code>IO</code> objects:
|
* returns them as a two-element array of <code>IO</code> objects:
|
||||||
* <code>[</code> <i>read_file</i>, <i>write_file</i> <code>]</code>. Not
|
* <code>[</code> <i>read_io</i>, <i>write_io</i> <code>]</code>. Not
|
||||||
* available on all platforms.
|
* available on all platforms.
|
||||||
*
|
*
|
||||||
* If an optional argument is specified, read string from pipe is tagged
|
* If an encoding (encoding name or encoding object) is specified as an optional argument,
|
||||||
* with the encoding specified. If encoding is a comma separated two
|
* read string from pipe is tagged with the encoding specified.
|
||||||
* encoding names "A:B", the read string is converted from encoding A
|
* If the argument is a colon separated two encoding names "A:B",
|
||||||
* (external encoding) to encoding B (internal encoding), then tagged
|
* the read string is converted from encoding A (external encoding)
|
||||||
* with B. If two optional arguments are specified, those must be
|
* to encoding B (internal encoding), then tagged with B.
|
||||||
* encoding objects, and the first one is the external encoding, and the
|
* If two optional arguments are specified, those must be
|
||||||
* second one is the internal encoding.
|
* encoding objects or encoding names,
|
||||||
|
* and the first one is the external encoding,
|
||||||
|
* and the second one is the internal encoding.
|
||||||
*
|
*
|
||||||
* In the example below, the two processes close the ends of the pipe
|
* In the example below, the two processes close the ends of the pipe
|
||||||
* that they are not using. This is not just a cosmetic nicety. The
|
* that they are not using. This is not just a cosmetic nicety. The
|
||||||
@ -5975,15 +5984,16 @@ rb_io_internal_encoding(VALUE io)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* io.set_encoding(enc) => io
|
* io.set_encoding(ext_enc) => io
|
||||||
* io.set_encoding(enc1, enc2) => io
|
* io.set_encoding("ext_enc:int_enc") => io
|
||||||
|
* io.set_encoding(ext_enc, int_enc) => io
|
||||||
*
|
*
|
||||||
* If single argument is specified, read string from pipe is tagged
|
* If single argument is specified, read string from io is tagged
|
||||||
* with the encoding specified. If encoding is a comma separated two
|
* with the encoding specified. If encoding is a colon separated two
|
||||||
* encoding names "A:B", the read string is converted from encoding A
|
* encoding names "A:B", the read string is converted from encoding A
|
||||||
* (external encoding) to encoding B (internal encoding), then tagged
|
* (external encoding) to encoding B (internal encoding), then tagged
|
||||||
* with B. If two arguments are specified, those must be encoding
|
* with B. If two arguments are specified, those must be encoding
|
||||||
* objects, and the first one is the external encoding, and the
|
* objects or encoding names, and the first one is the external encoding, and the
|
||||||
* second one is the internal encoding.
|
* second one is the internal encoding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
2
proc.c
2
proc.c
@ -184,7 +184,7 @@ proc_clone(VALUE self)
|
|||||||
*
|
*
|
||||||
* define_method always defines a method without the tricks,
|
* define_method always defines a method without the tricks,
|
||||||
* even if a non-lambda Proc object is given.
|
* even if a non-lambda Proc object is given.
|
||||||
* This is only the exception which the tricks is changed.
|
* This is the only exception which the tricks are not preserved.
|
||||||
*
|
*
|
||||||
* class C
|
* class C
|
||||||
* define_method(:e, &proc {})
|
* define_method(:e, &proc {})
|
||||||
|
4
string.c
4
string.c
@ -103,11 +103,11 @@ single_byte_optimizable(VALUE str)
|
|||||||
if (rb_enc_mbminlen(enc) == 1 && rb_enc_mbmaxlen(enc) == 1)
|
if (rb_enc_mbminlen(enc) == 1 && rb_enc_mbmaxlen(enc) == 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Not precise. It may be ENC_CODERANGE_UNKNOWN. */
|
/* Conservative. It may be ENC_CODERANGE_UNKNOWN. */
|
||||||
if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT)
|
if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Not precise. Possibly single byte.
|
/* Conservative. Possibly single byte.
|
||||||
* "\xa1" in Shift_JIS for example. */
|
* "\xa1" in Shift_JIS for example. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user