UK: no it wouldn't. UK law permits 'reasonable force'; shooting someone coming at you in close quarters with a knife sounds reasonable. Shooting someone who punches you, not so much.
Of course this is probably untested in court as no one here carries a gun.
In practice, that "reasonable force" judgement call and the often demonstrated lack prosecutoral good will results in atrocities like this one, which was merely the first I found with a quick Google search: http://www.telegraph.co.uk/news/uknews/1461346/Five-years-in...
It can most certainly come up in home invasions, another article by the BBC mentioned about 11 cases in the recent past.