ruby version 1.8 supported

* Change way to create proc , ->(x){..}  => lambda { |x|.. }
* Only use String#force_encoding when it exists