By Jonathan Head
BBC News, Bangkok
Until this month, few people had ever heard of, let alone read, a novel by aspiring Australian writer Harry Nicolaides entitled Verisimilitude.
King Bhumibol is revered by many in Thailand
According to the author, it was published three years ago, and in his own words "pulls away the mask of benign congeniality that Thailand has disguised itself with for decades, and reveals a people who are obsessed with Western affluence and materialism".
The book sank into immediate obscurity. Only 50 copies were printed, and just seven sold.
Mr Nicolaides, 41, continued to work in Thailand - as a lecturer in hospitality and tourism at a university in the northern town of Chiang Rai, writing the occasional article on lurid topics like the trade in child pornography, or relationships with Thai bar-girls. There are plenty of other foreigners making a living in much the same way.
But one passage in his forgotten novel has come back to haunt him.
It refers briefly, and unflatteringly, to the lifestyle of a crown prince, presumed by the Thai authorities to be Prince Maha Vajiralongkorn, heir to the throne. They have used it as the basis for a charge of "lese-majeste" against Mr Nicolaides.
A warrant for his arrest was issued in March this year, but - such is the habitual secrecy that surrounds all "lese-majeste" cases - he was never informed of this.
He continued to travel in and out of Thailand on visa runs, until 31 August, when he was detained as he was about to board a flight to Australia.
Today he is being held in a remand centre in Bangkok, awaiting trial.
Thai sportsmen held the king's image to mark their victories in Beijing
He was able to raise bail of 500,000 Thai baht ($15,000), but denied it on the grounds that he might flee the country.
Clearly stressed and bewildered, he was able to speak to reporters briefly during visiting hour.
"I feel persecuted, to be honest," he said. "I don't feel I belong here. I want to be given a chance to apologise and explain, but not be in here, and experience these indignities and inhumanities," Mr Nicolaides said.
He said he was being held in a cell with 90 other inmates, all of them Thai.
"Someone learned that I am here for offending the monarch, and I had some very icy looks from men with tattoos from neck-to-toe," he said.
The nightmarish situation Mr Nicolaides finds himself in is a chilling reminder of the severity of Thailand's "lese-majeste" law - he faces up to 15 years in jail - and of the unpredictability of its enforcement.
Oliver Jufer, a Swiss national, was pardoned by the Thai king in 2007
The clause in all recent Thai constitutions (there have been 17 since 1932) simply reads: "The King shall be enthroned in a position of revered worship and shall not be violated. No person shall expose the King to any sort of accusation or action."
Article 112 of the Thai Criminal Code reads: "Whoever defames, insults or threatens the King, Queen, the Heir-apparent or the Regent, shall be punished with imprisonment of three to 15 years."
Nowhere is there a definition of what constitutes an insult to the monarchy. Nor does the royal family ever invoke the law itself - "lese-majeste" complaints can be filed by anyone, against anyone, and they must always be formally investigated by the police.
So, the law has netted an odd assortment of offenders over the years.
A drunk Swiss man who sprayed graffiti on the king's portrait; a French passenger on Thai Airways who refused to turn off his reading light while sitting next to a princess; and more recently two young Thais who failed to stand up for the king's anthem in the cinema.
But the authorities do appear to be getting tougher on any comments deemed insulting or damaging to the royal family.
The government recently announced it was blocking 1,200 websites, a third of them because they referred to the monarchy (the rest were blocked mainly because they were pornographic).
This heightened sensitivity is understandable, as King Bhumibol is 80 years old, and there is acute public anxiety over the succession and the untested capabilities of the crown prince.
At a time of such political turmoil, maintaining the monarchy's image has become a vital priority.
Harry Nicolaides now says he wants to apologise wholeheartedly for any offence his novel caused.
"I do feel some clemency should be extended to cases where a person's record demonstrates they are not running an ongoing campaign against the crown," he said.
He is probably fortunate. Even if he is convicted and sentenced, in the past King Bhumibol has always quickly pardoned foreigners who have found themselves on the wrong side of this law.