A pregnant woman who says she was raped at an Australia detention center for asylum seekers on the tiny South Pacific island of Nauru cannot be forced to have an abortion in Papua New Guinea because it is unsafe and illegal, a court has ruled.