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

ruby-changes:39699

From: nobu <ko1@a...>
Date: Mon, 7 Sep 2015 14:47:54 +0900 (JST)
Subject: [ruby-changes:39699] nobu:r51780 (trunk): localeinit.c: locale_charmap rdoc [ci skip]

nobu	2015-09-07 14:47:34 +0900 (Mon, 07 Sep 2015)

  New Revision: 51780

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

  Log:
    localeinit.c: locale_charmap rdoc [ci skip]
    
    * localeinit.c (rb_locale_charmap): [RDOC] move
      Encoding.locale_charmap rdoc from encoding.c.

  Modified files:
    trunk/encoding.c
    trunk/localeinit.c
Index: encoding.c
===================================================================
--- encoding.c	(revision 51779)
+++ encoding.c	(revision 51780)
@@ -1514,31 +1514,6 @@ set_default_internal(VALUE klass, VALUE https://github.com/ruby/ruby/blob/trunk/encoding.c#L1514
     return encoding;
 }
 
-/*
- * 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.
- *
- */
 static void
 set_encoding_const(const char *name, rb_encoding *enc)
 {
@@ -1900,7 +1875,7 @@ Init_Encoding(void) https://github.com/ruby/ruby/blob/trunk/encoding.c#L1875
     rb_define_singleton_method(rb_cEncoding, "default_external=", set_default_external, 1);
     rb_define_singleton_method(rb_cEncoding, "default_internal", get_default_internal, 0);
     rb_define_singleton_method(rb_cEncoding, "default_internal=", set_default_internal, 1);
-    rb_define_singleton_method(rb_cEncoding, "locale_charmap", rb_locale_charmap, 0);
+    rb_define_singleton_method(rb_cEncoding, "locale_charmap", rb_locale_charmap, 0); /* in localeinit.c */
 
     list = rb_ary_new2(enc_table.count);
     RBASIC_CLEAR_CLASS(list);
Index: localeinit.c
===================================================================
--- localeinit.c	(revision 51779)
+++ localeinit.c	(revision 51780)
@@ -50,6 +50,31 @@ locale_charmap(VALUE (*conv)(const char https://github.com/ruby/ruby/blob/trunk/localeinit.c#L50
 #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)
 {

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

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