fixes #301 - ensures newlines are replaced as expected in urlSafeB64Encode function