rb::encode nearly completed