Ruby utf8 to ansel converter

I use a rails plugin that transforms ansel to utf8 by an addition to
I am now looking for a solution to the other part of the problem, to
convert utf8 to ansel

I have not found any railsplugin that solves that problem, but there
are some Perl and C++ solutions.
My question is now if one could convert utf8 to ansel by just
exchanging all utf8 character codes to corresponding ansel codes
using some ruby string function, although that would be a very
ineffektiv solution, or is the problem more complex ?

Is there a better way to solve the problem in ruby ?

Which ruby function should be used considering that an utf8 character
corresponds to multiple ansel characters ?

Anyone that knows any plugin or similar that could be used, as a part
of the solution ?

Would appreciate any help