Fix some Ruby encoding conversion problems