summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS.H <[email protected]>2022-02-02 22:52:55 +0900
committer<[email protected]>2022-02-02 22:52:55 +0900
commitaf107710457b4bd148c6e5ee7a336ed4961f5423 ()
tree851add668477910bd07f1c8de56d86f93f7ea498
parentd8c54bac4abd9ae42ac9d728cb4cbe1e101c7ad7 (diff)
Add `econv_get_encoding` function
Notes: Merged: https://.com/ruby/ruby/pull/5509 Merged-By: nobu <[email protected]>
-rw-r--r--transcode.c16
1 files changed, 10 insertions, 6 deletions
@@ -3499,6 +3499,14 @@ check_econv(VALUE self)
return ec;
}
/*
* call-seq:
* ec.source_encoding -> encoding
@@ -3509,9 +3517,7 @@ static VALUE
econv_source_encoding(VALUE self)
{
rb_econv_t *ec = check_econv(self);
- if (!ec->source_encoding)
- return Qnil;
- return rb_enc_from_encoding(ec->source_encoding);
}
/*
@@ -3524,9 +3530,7 @@ static VALUE
econv_destination_encoding(VALUE self)
{
rb_econv_t *ec = check_econv(self);
- if (!ec->destination_encoding)
- return Qnil;
- return rb_enc_from_encoding(ec->destination_encoding);
}
/*