support ruby < 2 by adding utf8 encoding