Fix encoding issues with metadata for Ruby 1.8 & 1.9