Charles Dickens would have felt at home in the streets of Dhaka. The barefoot children waiting for their mothers and sisters to come home from the textile mills; the chimneys of the brick factories, like a throwback to the pages of Bleak House, vaguely visible in the smog. And the stench.

Like Victorian London, the shanty towns of Bangladesh's capital reek of excrement dropped from makeshift hanging toilets perched precariously on bamboo stilts a couple of metres above the mire. Bangladesh is the object of the world's pity this week as it deals with the cyclone that killed more than 3,000 people. Yet when the TV appeals are over, when attention has switched to another country stricken by flood, famine or earthquake, the stench of raw sewage will remain. And it will still be the second biggest killer of children after respiratory illnesses: 200 perish every hour as a result of living conditions that would cause an outcry if they occurred in the west and should cause an outcry because they are allowed to happen anywhere.

With our flushing toilets and mains drainage, it's hard to recall that London was once Dhaka when it came to sanitation. The Great Wen, the fast-growing metropolis that was the hub of the British empire in the mid-19th century, could not cope with the pace of urbanisation. Cesspits overflowed into the homes of the poor and the Thames ran sluggishly with raw sewage.

In 1858, a particularly hot summer, MPs got a whiff of the problem as the Great Stench, as it was called, wafted through the mother of parliaments. In less than three weeks, the government had commissioned Sir Joseph Bazalgette to develop a new sewage system that prevented toilet waste from going into the river or accumulating near homes.

The results were instant. People stopped dying of cholera and typhoid, and when there was an even larger investment in sanitation in the 1890s it produced the biggest drop in infant mortality ever seen in Britain. That was then. Last week, the United Nations launched its year of sanitation to mark the fact that 2.6 billion people - almost half the world's population - still live in insanitary conditions considered repugnant and intolerable by the Victorians.

Yet perhaps because we in the west take clean water and sanitation for granted, providing septic tanks and u-bends have never quite had the emotional appeal of starving babies, HIV/Aids patients and children desperate to go to school.

Sanitation is such a low priority that when the UN drew up its list of millennium development goals to be achieved by 2015, ensuring that the children of slum dwellers in Dhaka could go to the toilet without endangering their lives did not feature among them.

After pressure from charities such as WaterAid, the UN later agreed to set a target for halving the number of people without access to clean water and sanitation, but on current trends the target will not be achieved until more than half a century later. Rich countries have promised to double assistance by 2010 but have yet to deliver - spending on water and sanitation has actually fallen.

WaterAid says much of the extra spending on education will be wasted if children with diarrhoea are too sick to go to school or if girls take one week off in a month because there are no facilities for them to menstruate with modesty. Every dollar spent on sanitation leads to $9 of returns in health - a stupendous return on investment.

Shift in attitudes

Britain is one of the few countries to make a priority of water and sanitation and has supported the military-backed government in Bangladesh in its attempt to provide 100% access to sanitation not by 2015 but by 2010. It's a real challenge, not out in the rural areas, but in Dhaka, where the pressures of being one of the world's fastest growing cities push the slums further and further out each year

Abul Barkat, economics professor at the University of Dhaka, says what is happening in the city is not so much urbanisation as slumisation; he is sceptical about official figures showing that sanitation coverage has increased from 33% in 2003 to 84% today.

Paul Edwards, who works for Unicef in Bangladesh, agrees, noting that not all the toilets would qualify as providing decent sanitation, since many lack a seal between the pit and the external environment. "But I'm fairly confident that there has been a shift in attitudes. People want to own their own toilets."

The government's first attempt at increasing coverage for sanitation was a failure; it committed scarce resources from its budget, bought the sanitary hardware, delivered it across the country, and then saw nothing happen.

Things only started to change once power was devolved to a lower level, raising awareness of the benefits of sanitation at a community level and obliging every family, no matter how poor they were, to make a contribution, perhaps through free labour, to the installation of their own toilet. Richer families subsidised poor ones, and children were mobilised to put pressure on anybody who decided that the new-fangled latrines were no match for defecating in the open. In a village close to Jamalpur, a five-hour drive from Dhaka, there is now 100% sanitation coverage. Women, in particular, say having their own toilets has given them privacy, safety and better health for their children. Laily Begum, a mother of three, says: "The children used to suffer badly with diarrhoea. Now there is no diarrhoea, no sickness. In the past many of us were frightened to go out when it was dark for fear of being attacked."

In the cities, the scale of the task is much more daunting. Dhaka has only one reticulated sewage treatment plant covering a quarter of the city's estimated 12 million population. Chittagong, with the same size population as Chicago, doesn't have one at all.

Expertise

The ever-present danger is of water supply being contaminated by human waste, particularly since the country is vulnerable to weather patterns associated with climate change.

Jan Moller Hansen, of the Danish embassy, said: "Dhaka is expanding faster than the ability of the city to cope. But it's not a lack of technical expertise, it's a question of policies, institutions and financial resources."

In Britain, action was speeded up by demands from the private sector, but Mohammed Sabur, WaterAid's director in Bangladesh, said: "In Britain, the factory owners wanted healthy workers. Here, if 100 workers are sick there are 200 to take their place. The only company likely to exert pressure for better sanitation here is Unilever, so that they can sell more soap."

That vacuum needs to be filled - by western governments and by aid organisations - and not just for Bangladesh but for all the even poorer countries in sub-Saharan Africa where sanitation is not a government priority. The alternative is to hold our noses and pretend it isn't happening.