Kim Jong Il is neither insane nor stupid.
From the CIA's psychological profilers to his many biographers, experts who have studied the North Korean leader believe that beneath the glaring eccentricities -- the bouffant hairdo and the oddball Mao suits -- there is a shrewd operator at work.
Despite an image as a "nut with a nuke," as some bloggers have disparaged him, the 64-year-old Kim appears to have carefully orchestrated his country's path to nuclear sovereignty.
If the announced test is confirmed, one of the world's poorest and most dysfunctional countries will have become an unlikely gate crasher in the exclusive club of nuclear powers.
That is an achievement Kim apparently believes will ensure the top item on his agenda: maintaining power.
In Kim's eyes, a nuclear weapon should prevent the United States from attempting to topple him from his post in the manner of Iraq's Saddam Hussein. And the indomitable mystique of nuclear capability could in part substitute for the charisma that Kim, unlike his late father, Kim Il Sung, is lacking.
"In the eyes of the North Korean leaders, this was very calculated and rational behavior," said Paik Hak-soon, a political scientist at South Korea's Sejong Institute. "Nobody invades a nuclear power. People respect nuclear power."
Biographers over the years have frequently made the point that Kim Jong Il did not merely inherit power, he fought for it. Short, dumpy and lacking in charm, the younger Kim had to contend with other possible successors before taking over in 1994 upon the death of his father.
Far less popular domestically than Kim Il Sung, he also has had his hands full staying in control -- especially given the economic basket case that North Korea became on his watch. It is unclear as well whether he will be able to pass on power to any of his three sons.
Jerrold M. Post, founder of the CIA's Center for the Analysis of Personality and Political Behavior who now teaches at George Washington University, says Kim has had a tough act to follow because of a North Korean propaganda machine that extolled his father as a god.
"You have other world leaders whose fathers led before them -- King Abdullah of Jordan, Bashar Assad of Syria -- but their job pales in comparison to Kim Jong Il.... He had to be the son of God and to sustain the charismatic cult of personality," Post said.
A psychiatrist by training, Post does not believe that Kim is psychotic but that he has a dangerous personality disorder that Post diagnoses as "malign narcissism." As such, Kim has loyalty only to himself and lacks the ability to consider other people's feelings.
Kim's blatant disregard for his own people allowed him to become one of the Asia's top gourmets at a time when up to 20% of North Korea's population was dying of starvation. To indulge his private whims, he is said to have imported a sushi chef from Japan and a pizza maker from Italy, both of whom later wrote "cook-and-tell" accounts of their experiences. He dispatched couriers to Europe to pick up epicurean treats and ordered each grain of his rice inspected, according to the chefs' accounts.
North Korea's leader apparently saw no hypocrisy in exiling people to prison camps for watching foreign media, while he personally amassed a collection of 20,000 foreign film titles. From the time that President Carter visited Pyongyang in 1994 with copies of "Gone With the Wind" and "The Godfather," foreign dignitaries have been bearing such gifts. The ABC television network, granted a visa to North Korea last year, is said to have brought in, on special request, the complete "Desperate Housewives" series.
Kim is known to love cinema. He once ordered the kidnapping of a South Korean actress and her director husband to run North Korea's film studio. He wrote a book, "On the Art of Cinema," on using film to instill socialist values in the masses. His first serious job, at 30, was with the Department of Propaganda and Agitation for the ruling Workers' Party.
He oversaw a propaganda machine that maintained the elaborate mythology about the ruling family, including the claim that his own birth (like that of Christ) was heralded by the appearance of a bright star.
But Kim was not so delusional to be fooled by his own propaganda, and he knew he would need more to keep himself in power. After 1980, he turned his attention from cinema to weapons of mass destruction.
"Big toys for big boys" is how his psychological profiler, Post, puts it.
Kim steered a nuclear energy program that had been launched in the 1960s more in the direction of weapons development. According to numerous accounts by defectors, he ordered nuclear research and missile development projects moved from the purview of the military to the Workers' Party Central Committee so he could be more intimately involved.