TOKYO — Japan’s Supreme Court ruled Wednesday that requiring married couples to have the same surname is constitutional, dealing a blow to a longtime effort for gender equality in choosing names.

The law does not say which partner must give up his or her name in marriage.

In practice it has almost always been the woman who took the husband’s name. Some women say that is unfair and they feel as though their identity is lost.

In traditional marriage, one person, usually the woman, enters the household of the partner and is registered as a member of that household.

Men are seen as more powerful in Japanese traditional culture. But as women increasingly have careers, some argue that changing surnames is confusing.

Some Japanese women continue to use their maiden name professionally, even after their surnames are legally changed following marriage.

Some couples simply don’t register their marriages.

In a separate case, however, the Supreme Court ruled that prohibiting women from remarrying for six months is unconstitutional.