Make work with ruby 1.8

Fixed using force_encoding without checking method presence and use Time.local instead of Time.new in tests.