Fix percent_encode for 2.7