ruby-changes:8040
From: usa <ko1@a...>
Date: Fri, 26 Sep 2008 11:07:43 +0900 (JST)
Subject: [ruby-changes:8040] Ruby:r19565 (trunk): * transcode.c, include/ruby/encoding.c (rb_transcode_convertible):
usa 2008-09-26 11:07:19 +0900 (Fri, 26 Sep 2008) New Revision: 19565 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19565 Log: * transcode.c, include/ruby/encoding.c (rb_transcode_convertible): new function. checking the existance of converter. Modified files: trunk/ChangeLog trunk/include/ruby/encoding.h trunk/transcode.c Index: include/ruby/encoding.h =================================================================== --- include/ruby/encoding.h (revision 19564) +++ include/ruby/encoding.h (revision 19565) @@ -209,6 +209,7 @@ typedef struct rb_econv_t rb_econv_t; VALUE rb_str_transcode(VALUE str, VALUE to, int ecflags, VALUE ecopts); +int rb_transcode_convertible(const char* from_encoding, const char* to_encoding); int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts); Index: ChangeLog =================================================================== --- ChangeLog (revision 19564) +++ ChangeLog (revision 19565) @@ -1,3 +1,8 @@ +Fri Sep 26 11:05:41 2008 NAKAMURA Usaku <usa@r...> + + * transcode.c, include/ruby/encoding.c (rb_transcode_convertible): + new function. checking the existance of converter. + Fri Sep 26 10:35:50 2008 Nobuyoshi Nakada <nobu@r...> * variable.c (global_variable, struct trace_var): made function Index: transcode.c =================================================================== --- transcode.c (revision 19564) +++ transcode.c (revision 19565) @@ -2839,6 +2839,20 @@ return convpath; } +/* + * check the existance of converter. + * returns the count of the converting paths. + * result: >=0:success -1:failure + */ +int +rb_transcode_convertible(const char* from_encoding, const char* to_encoding) +{ + VALUE convpath = Qnil; + transcode_search_path(from_encoding, to_encoding, search_convpath_i, + &convpath); + return RTEST(convpath); +} + struct rb_econv_init_by_convpath_t { rb_econv_t *ec; int index; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/