UNTIL a year ago, Mama Yuli could count on a steady stream of reporters and television crews to make their way to her small orange house in Jakarta’s suburbs for a peek at what is thought to be Indonesia’s only shelter for transgender women. Yulianus Rettoblaut—Mama Yuli’s full name—had made a splash as the first openly transgender woman to obtain a master’s degree in Indonesia. She had also tried twice to become a member of the Human Rights Commission.

WBut the coverage came to an abrupt halt last year. That is unfortunate, as Mama Yuli needs the donations that came with it. The shelter is home to six transgender women, though many more come and go. On a recent day there were nine. It is far from luxurious: a leaky roof had forced several of them to sleep on the floor, and a broken toilet added to their indignities. “We often invite television to come and now they say ‘No’,” Mama Yuli laments.

In early 2016 the Indonesia Broadcasting Commission banned television stations from screening images of “effeminate men” or of anyone campaigning for rights for gay or transgender people, to protect children from “deviant” influences. The pressure on gay and transgender Indonesians has only increased since. In May in Aceh province, which has used its special, semi-autonomous status to adopt some elements of sharia (Islamic law), the authorities publicly caned two men caught having sex with one another. Indonesia does not have a national law against sodomy, but around the same time the police in Jakarta rounded up 140 or so men at a gay sauna, saying they may have broken the law on pornography. The police chief of the province of West Java, Anton Charliyan, has pledged to set up an anti-gay task force, charged with trawling through social media posts to detect gay events to raid.

Indonesia has a long-standing, indigenous transgender tradition. Men who identify as women are labelled waria, a fusion of the words for men and women. During the 1960s the governor of Jakarta, Ali Sadikin, founded an advocacy group for waria. Wariadancers were among the attractions at the annual Jakarta Fair. Until recently gay venues and gay activism were grudgingly tolerated in big cities.

A wave of anti-gay hysteria is now testing this tolerance. In July Map Boga Adiperkasa, a company that runs the local branches of Starbucks, disavowed the brand’s support for gay rights after a huge Muslim group called for a boycott. Several politicians have proposed criminalising homosexuality. There is much talk of the insidious threat to the fabric of the nation.

The government of Joko Widodo, the reformist president, has joined in. Ministers have mused about banning gay student groups from universities, or attempting to weed out gay civil servants. The attorney-general’s office has stated explicitly that it will not hire any gay or transgender staff. (Indonesia does not have a law protecting gay or transgender people from discrimination.)
Some see this moralising as bluster, designed to burnish the government’s Islamic credentials at a time when it is taking on radical groups. In July Jokowi, as the president is known, issued a proclamation banning the Hizbut Tahrir Indonesia, which wants to replace the government with a caliphate. The authorities are also seeking the arrest of the head of the Islam Defenders Front, a vigilante group, on suspicion of breaking the law on pornography by sexting a woman who is not his wife.

It is little consolation to gay and transgender Indonesians that the government’s outrage may be feigned. Conservative Muslim activists have been emboldened by their success in ousting Jakarta’s governor earlier this year over supposedly blasphemous comments he made during his re-election campaign. The constitutional court is hearing a case that may result in sodomy becoming a crime. Governments in several provinces other than Aceh have already passed local laws to that effect.

Undeterred, Mama Yuli is pursuing a doctorate in part to inspire other waria to get an education. Many are renounced by their families as teenagers, and end up as beggars or sex workers. This, Mama Yuli says, hands ammunition to conservatives: “The most important thing is that they have to change their behaviour.””

This article appeared in the Asia section of the print edition of The Economist under the headline "Looking for shelter" Click here for the piece.