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

ruby-changes:41243

From: nobu <ko1@a...>
Date: Sat, 26 Dec 2015 11:27:00 +0900 (JST)
Subject: [ruby-changes:41243] nobu:r53315 (trunk): miniinit.c: built-in encoding aliases

nobu	2015-12-26 11:26:40 +0900 (Sat, 26 Dec 2015)

  New Revision: 53315

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

  Log:
    miniinit.c: built-in encoding aliases
    
    * miniinit.c (Init_enc): add some common aliases of built-in
      encodings.  [ruby-core:72481] [Bug #11872]

  Modified files:
    trunk/ChangeLog
    trunk/miniinit.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53314)
+++ ChangeLog	(revision 53315)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec 26 11:26:38 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* miniinit.c (Init_enc): add some common aliases of built-in
+	  encodings.  [ruby-core:72481] [Bug #11872]
+
 Sat Dec 26 01:24:40 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in, version.h (RUBY_PROGRAM_VERSION): extract version
Index: miniinit.c
===================================================================
--- miniinit.c	(revision 53314)
+++ miniinit.c	(revision 53315)
@@ -36,11 +36,14 @@ Init_enc_set_filesystem_encoding(void) https://github.com/ruby/ruby/blob/trunk/miniinit.c#L36
     return rb_enc_to_index(rb_default_external_encoding());
 }
 
+void rb_encdb_declare(const char *name);
+int rb_encdb_alias(const char *alias, const char *orig);
 void
 Init_enc(void)
 {
-    void rb_encdb_declare(const char *name);
     rb_encdb_declare("ASCII-8BIT");
     rb_encdb_declare("US-ASCII");
     rb_encdb_declare("UTF-8");
+    rb_encdb_alias("BINARY", "ASCII-8BIT");
+    rb_encdb_alias("ASCII", "US-ASCII");
 }

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

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