# Rb\_set\_kcode equivalent for 1.9.x

**URL:** <https://www.ruby-forum.com/t/rb-set-kcode-equivalent-for-1-9-x/193089>\
**Category:** Ruby\
**Created:** [August 11, 2010, 2:08am UTC](https://www.ruby-forum.com/t/rb-set-kcode-equivalent-for-1-9-x/193089 "2010-08-11T02:08:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reverri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@reverri](https://www.ruby-forum.com/u/reverri)\
**Post date:** [August 11, 2010, 2:08am UTC](https://www.ruby-forum.com/t/rb-set-kcode-equivalent-for-1-9-x/193089/1 "2010-08-11T02:08:37Z")

</div>

The C function rb\_set\_kcode was defined in the 1.8.x branch.

In the 1.9.x branch, the encoding was overhauled, and all the methods  
were renamed (without aliasing, it seems.)

I use an application than loads the Ruby interpreter (as a scripting  
engine.) It loads 1.8.x fine, but cannot load 1.9.x (“rb\_set\_kcode entry  
point not found” or similar error occurs.)

The application calls rb\_set\_kcode to set encoding to UTF8.

I’d like to inform the software company of the new call for 1.9.x, can  
anyone tell me what the correct call would be to set encoding to UTF8 in  
1.9.x ??

P.S. - I need the C function call not the Ruby call, not the Ruby  
command line argument -K.

It’s something like rb\_enc\_somefunction\_name( arg )
