Encode solution string before decoding

This should fix tests on Python 3.2 where b64decode requires bytes.