updated to work on 2.1.2 ruby although failing tests on encoding