summaryrefslogtreecommitdiff
path: root/localeinit.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-07 05:47:34 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-07 05:47:34 (GMT)
commit09421c5da1196fde3a8d623f0db02fb739545023 (patch)
treedddd0436313aee4997c3c0445b016d3a74185c61 /localeinit.c
parent5bed80ee36f92c42b39278d4f1f19fff3c554b34 (diff)
localeinit.c: locale_charmap rdoc [ci skip]
* localeinit.c (rb_locale_charmap): [RDOC] move Encoding.locale_charmap rdoc from encoding.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'localeinit.c')
-rw-r--r--localeinit.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/localeinit.c b/localeinit.c
index a5368cc..c83bf7e 100644
--- a/localeinit.c
+++ b/localeinit.c
@@ -50,6 +50,31 @@ locale_charmap(VALUE (*conv)(const char *))
#endif
}
+/*
+ * call-seq:
+ * Encoding.locale_charmap -> string
+ *
+ * Returns the locale charmap name.
+ * It returns nil if no appropriate information.
+ *
+ * Debian GNU/Linux
+ * LANG=C
+ * Encoding.locale_charmap #=> "ANSI_X3.4-1968"
+ * LANG=ja_JP.EUC-JP
+ * Encoding.locale_charmap #=> "EUC-JP"
+ *
+ * SunOS 5
+ * LANG=C
+ * Encoding.locale_charmap #=> "646"
+ * LANG=ja
+ * Encoding.locale_charmap #=> "eucJP"
+ *
+ * The result is highly platform dependent.
+ * So Encoding.find(Encoding.locale_charmap) may cause an error.
+ * If you need some encoding object even for unknown locale,
+ * Encoding.find("locale") can be used.
+ *
+ */
VALUE
rb_locale_charmap(VALUE klass)
{