Afghanistan’s Pul-i-Charkhi prison, once described by a newspaper as a “kind of Buchenwald,” has become a model for prison reform in the war-torn country, said officials of the United Nations, which is taking a lead role in the difficult task of improving the detention and legal system countrywide.