summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 11:24:44 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 11:24:44 +0000
commit62c596cb36af5471e65a4774dfe70047055f58b7 (patch)
tree7a54edda3aa4d207855902387653fadfe291db9a
parentbb8ddbe8471d4d1a66b79956b7697f947fb0a61d (diff)
* encoding.c: add documents.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--encoding.c34
2 files changed, 34 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e52f6b..706cb3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jan 13 20:24:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c: add documents.
+
Sun Jan 13 18:41:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (Init_Encoding): moved initialization from encdb.h.
diff --git a/encoding.c b/encoding.c
index 9abfe2a..d892c8f 100644
--- a/encoding.c
+++ b/encoding.c
@@ -757,16 +757,14 @@ enc_base_encoding(VALUE self)
* Returns the list of loaded encodings.
*
* Encoding.list
- * => [#<Encoding:ASCII-8BIT>, #<Encoding:EUC-JP>,
- * #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
+ * => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
* #<Encoding:ISO-2022-JP (dummy)>]
*
* Encoding.find("US-ASCII")
* => #<Encoding:US-ASCII>
*
* Encoding.list
- * => [#<Encoding:ASCII-8BIT>, #<Encoding:EUC-JP>,
- * #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
+ * => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
* #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
*
*/
@@ -1000,6 +998,22 @@ set_encoding_alias(st_data_t name, st_data_t orig, st_data_t arg)
return ST_CONTINUE;
}
+/*
+ * call-seq:
+ * Encoding.name_list => ["enc1", "enc2", ...]
+ *
+ * Returns the list of available encoding names.
+ *
+ * Encoding.name_list
+ * => ["US-ASCII", "ASCII-8BIT", "UTF-8",
+ * "ISO-8859-1", "Shift_JIS", "EUC-JP",
+ * "Windows-31J",
+ * "BINARY", "CP932", "eucJP"]
+ *
+ * This list doesn't include dummy encodings.
+ *
+ */
+
static VALUE
rb_enc_name_list(VALUE klass)
{
@@ -1025,6 +1039,18 @@ rb_enc_aliases_str_i(st_data_t name, st_data_t orig, st_data_t arg)
return 0;
}
+/*
+ * call-seq:
+ * Encoding.aliases => {"alias1" => "orig1", "alias2" => "orig2", ...}
+ *
+ * Returns the hash of available encoding alias and original encoding name.
+ *
+ * Encoding.aliases
+ * => {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII",
+ * "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
+ *
+ */
+
static VALUE
rb_enc_aliases(VALUE klass)
{