Fix some Ruby encoding conversion problems

A Ruby encoding exception gets raised if I try to upload a gem using the web interface. This change fixes the problem.