diff --git a/ChangeLog b/ChangeLog index 3161e8a554..74e6c3865d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Jan 29 19:03:16 2008 NARUSE, Yui + + * enc/trans/japanese.c (rb_to_Windows_31J): to 'Windows-31J'. + + * common.mk: add rules for transdb.h. + + * transcode.c (init_transcoder_table): use transdb.h. + Tue Jan 29 18:05:48 2008 Nobuyoshi Nakada * encoding.c (encdb_{replicate,alias,dummy,declare}): define only if diff --git a/common.mk b/common.mk index 6d8590fcf3..83b9c2e829 100644 --- a/common.mk +++ b/common.mk @@ -100,7 +100,7 @@ BOOTSTRAPRUBY = $(BASERUBY) VCS = svn -all: $(MKFILES) $(PREP) encdb $(RBCONFIG) $(LIBRUBY) encs +all: $(MKFILES) $(PREP) encdb transdb $(RBCONFIG) $(LIBRUBY) encs @$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) prog: $(PROGRAM) $(WPROGRAM) @@ -433,10 +433,7 @@ dmyencoding.$(OBJEXT): {$(VPATH)}dmyencoding.c \ {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \ {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \ {$(VPATH)}oniguruma.h {$(VPATH)}regenc.h -encoding.$(OBJEXT): {$(VPATH)}encoding.c {$(VPATH)}ruby.h \ - {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \ - {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \ - {$(VPATH)}oniguruma.h {$(VPATH)}regenc.h {$(VPATH)}encdb.h +encoding.$(OBJEXT): dmyencoding.$(OBJEXT) {$(VPATH)}encdb.h enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h {$(VPATH)}config.h \ {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \ {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}util.h @@ -584,10 +581,11 @@ thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \ {$(VPATH)}debug.h {$(VPATH)}vm_opts.h {$(VPATH)}id.h \ {$(VPATH)}thread_$(THREAD_MODEL).h {$(VPATH)}dln.h {$(VPATH)}vm.h \ {$(VPATH)}gc.h {$(VPATH)}thread_$(THREAD_MODEL).c -transcode.$(OBJEXT): {$(VPATH)}transcode.c {$(VPATH)}ruby.h \ +dmytranscode.$(OBJEXT): {$(VPATH)}transcode.c {$(VPATH)}ruby.h \ {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \ {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}encoding.h \ {$(VPATH)}oniguruma.h {$(VPATH)}transcode_data.h +transcode.$(OBJEXT): dmytranscode.$(OBJEXT) {$(VPATH)}transdb.h cont.$(OBJEXT): {$(VPATH)}cont.c {$(VPATH)}ruby.h {$(VPATH)}config.h \ {$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \ {$(VPATH)}st.h {$(VPATH)}vm_core.h {$(VPATH)}signal.h {$(VPATH)}node.h \ @@ -704,7 +702,7 @@ vm.inc: $(srcdir)/template/vm.inc.tmpl srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c $(srcdir)/ext/ripper/ripper.c -incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h $(srcdir)/revision.h +incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h $(srcdir)/revision.h node_name.inc: {$(VPATH)}node.h $(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@ @@ -716,6 +714,13 @@ encdb: encdb.h: $(MINIRUBY) $(srcdir)/enc/make_encdb.rb $(srcdir)/enc $@ +transdb: + $(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $(srcdir)/enc/trans transdb.h.new + $(IFCHANGE) "transdb.h" "transdb.h.new" + +transdb.h: + $(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $(srcdir)/enc/trans $@ + miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@ diff --git a/enc/trans/japanese.c b/enc/trans/japanese.c index e523ca7100..fbd7937d04 100644 --- a/enc/trans/japanese.c +++ b/enc/trans/japanese.c @@ -13364,7 +13364,7 @@ rb_to_SHIFT_JIS = { }; static const rb_transcoder rb_to_Windows_31J = { - "UTF-8", "Windows_31J", &to_SHIFT_JIS, 2, 1, + "UTF-8", "Windows-31J", &to_SHIFT_JIS, 2, 1, NULL, NULL, }; diff --git a/transcode.c b/transcode.c index 7daca3694b..4173df9dc1 100644 --- a/transcode.c +++ b/transcode.c @@ -85,29 +85,9 @@ rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib) static void init_transcoder_table(void) { - rb_declare_transcoder("US-ASCII", "UTF-8", "single_byte"); - rb_declare_transcoder("ASCII-8BIT", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-1", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-2", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-3", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-4", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-5", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-6", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-7", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-8", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-9", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-10", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-11", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-13", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-14", "UTF-8", "single_byte"); - rb_declare_transcoder("ISO-8859-15", "UTF-8", "single_byte"); - rb_declare_transcoder("SHIFT_JIS", "UTF-8", "japanese"); - rb_declare_transcoder("EUC-JP", "UTF-8", "japanese"); - rb_declare_transcoder("ISO-2022-JP", "UTF-8", "japanese"); - rb_declare_transcoder("UTF-16BE", "UTF-8", "utf_16_32"); - rb_declare_transcoder("UTF-16LE", "UTF-8", "utf_16_32"); - rb_declare_transcoder("UTF-32BE", "UTF-8", "utf_16_32"); - rb_declare_transcoder("UTF-32LE", "UTF-8", "utf_16_32"); +#ifndef NO_TRANSDB_H +#include "transdb.h" +#endif } #define encoding_equal(enc1, enc2) (STRCASECMP(enc1, enc2) == 0)