Backport strict_encode64 for ruby 1.8