mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* transcode.c, include/ruby/encoding.c (rb_transcode_convertible):
new function. checking the existance of converter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4300e2a993
commit
e76b1a11ca
3 changed files with 20 additions and 0 deletions
14
transcode.c
14
transcode.c
|
@ -2839,6 +2839,20 @@ econv_s_search_convpath(int argc, VALUE *argv, VALUE klass)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue