mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@84 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c1657f302
commit
869a0bb90a
5 changed files with 54 additions and 6 deletions
|
@ -1787,6 +1787,20 @@ kconv_kconv(argc, argv)
|
|||
if (NIL_P(out)) {
|
||||
out_code = _JIS;
|
||||
}
|
||||
else if (TYPE(out) == T_STRING) {
|
||||
switch (RSTRING(out)->ptr[0]) {
|
||||
case 'E': case 'e':
|
||||
out_code = _EUC;
|
||||
break;
|
||||
case 'S': case 's':
|
||||
out_code = _SJIS;
|
||||
break;
|
||||
case 'J': case 'j':
|
||||
default:
|
||||
out_code = _JIS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
out_code = NUM2INT(out);
|
||||
if (out_code == _NOCONV) return (VALUE)src;
|
||||
|
@ -1794,6 +1808,22 @@ kconv_kconv(argc, argv)
|
|||
if (NIL_P(in)) {
|
||||
in_code = _AUTO;
|
||||
}
|
||||
else if (TYPE(in) == T_STRING) {
|
||||
switch (RSTRING(in)->ptr[0]) {
|
||||
case 'E': case 'e':
|
||||
in_code = _EUC;
|
||||
break;
|
||||
case 'S': case 's':
|
||||
in_code = _SJIS;
|
||||
break;
|
||||
case 'J': case 'j':
|
||||
in_code = _JIS;
|
||||
break;
|
||||
default:
|
||||
in_code = _AUTO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
in_code = NUM2INT(in);
|
||||
if (in_code == _NOCONV) return (VALUE)src;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue