There is no way to escape the URL but preserve the fragment part which is needed for the branch information.
If its truly needed, we would need to peel off the fragment before applying the escape.