ruby: various type encoding
ruby: use fast version by default.