Male urine is no deterrant for either, only thing is good for is the compost heap.
We have both a large community of badgers and foxes and neither were bothered when we first got the plot, infact we suffered more damage when we tried it
A sturdy and i mean sturdy fence is all that will work