Fixes encoding error for ruby < 2.0