fixed utf8 bug when locale not set, and improved testing for ruby 1.8.