diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-12 16:35:10 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-12 16:35:10 +0000 |
| commit | 61628104232d87392615e02bb87906754b7b4c3d (patch) | |
| tree | f1d02a17b15341237c9dbf80e84a44296b802edc /encoding.c | |
| parent | c12390bdc934bd7b501925e0979da7c68208bc25 (diff) | |
| download | ruby-61628104232d87392615e02bb87906754b7b4c3d.tar.gz ruby-61628104232d87392615e02bb87906754b7b4c3d.tar.xz ruby-61628104232d87392615e02bb87906754b7b4c3d.zip | |
Add rdoc and test of Encoding#replicate.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
| -rw-r--r-- | encoding.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/encoding.c b/encoding.c index 2d50f9f8a..22a03d0ae 100644 --- a/encoding.c +++ b/encoding.c @@ -313,6 +313,15 @@ rb_enc_replicate(const char *name, rb_encoding *encoding) return idx; } +/* + * call-seq: + * enc.replicate(name) => encoding + * + * Returns a replicated encoding of _enc whose name is _name_. + * The new encoding should have the same byte structure of _enc_. + * If _name_ is used by another encoding, raise ArgumentError. + * + */ static VALUE enc_replicate(VALUE encoding, VALUE name) { |
