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

ruby-changes:3297

From: ko1@a...
Date: 30 Dec 2007 06:34:28 +0900
Subject: [ruby-changes:3297] usa - Ruby:r14790 (trunk): * encoding.c (Init_encoding): register Windows-31J and its alias.

usa	2007-12-30 06:34:15 +0900 (Sun, 30 Dec 2007)

  New Revision: 14790

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c
    trunk/ruby.c

  Log:
    * encoding.c (Init_encoding): register Windows-31J and its alias.
      [ruby-dev:32843]
    
    * ruby.c (proc_options): -Ks options means Windows-31J, not Shift_JIS.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=14790&r2=14789
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14790&r2=14789
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14790&r2=14789

Index: encoding.c
===================================================================
--- encoding.c	(revision 14789)
+++ encoding.c	(revision 14790)
@@ -1011,6 +1011,9 @@
     /* dummy for unsupported, statefull encoding */
     rb_define_dummy_encoding("ISO-2022-JP");
 
+    rb_enc_replicate("Windows-31J", ONIG_ENCODING_SJIS);
+    rb_enc_alias("CP932", "Windows-31J");
+
     for (i = 0; i < enc_table_size; ++i) {
 	rb_encoding *enc = enc_table[i].enc;
 	if (enc) set_encoding_const(rb_enc_name(enc), enc);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14789)
+++ ChangeLog	(revision 14790)
@@ -1,3 +1,10 @@
+Sun Dec 30 06:31:11 2007  NAKAMURA Usaku  <usa@r...>
+
+	* encoding.c (Init_encoding): register Windows-31J and its alias.
+	  [ruby-dev:32843]
+
+	* ruby.c (proc_options): -Ks options means Windows-31J, not Shift_JIS.
+
 Sun Dec 30 06:27:38 2007  NAKAMURA Usaku  <usa@r...>
 
 	* lib/mkmf.rb (depend_rules): need to convert `/' to `\' for windows
Index: ruby.c
===================================================================
--- ruby.c	(revision 14789)
+++ ruby.c	(revision 14790)
@@ -712,7 +712,8 @@
 		    enc = ONIG_ENCODING_EUC_JP;
 		    break;
 		  case 'S': case 's':
-		    enc = ONIG_ENCODING_SJIS;
+		    enc = rb_enc_find("Windows-31J");
+		    if (!enc) enc = ONIG_ENCODING_SJIS;
 		    break;
 		  case 'U': case 'u':
 		    enc = ONIG_ENCODING_UTF8;

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

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