I have been trying not to write about Michel Houellebecq, if only because, these days, just about every writer who comes into conflict with the thin-skinned guardians of Islamic sanctities is forced to wear the "new Rushdie" cap, which is doubly depressing, firstly for me, because I detest having my name sloganised, as if I had become some sort of bad-mouthing literary category, and secondly for the writers in question - the "Bangladeshi Rushdie", the "Chinese Rushdie", and no doubt, shortly, the "first Rushdie in space" - who quite rightly resent having the darkest chapter of my story superimposed upon their own difficulties.

Now, however, Houellebecq has been brought to court in France by four Muslim bodies - the largest mosques in Paris and Lyon, the National Federation of French Muslims and the World Islamic League - accused of "making a racial insult" and of "inciting religious hatred". The gravity of this suit against a multi-award-winning writer widely acknowledged as one of Europe's finest, if least comfortable, newer talents, obliges all good men, as the saying goes, to come to the aid of the party.

Or so you'd think. And indeed, several French intellectuals and publishers have defended Houellebecq. But many others have signally failed to do so. The prestigious Human Rights League has accused him of Islamophobia and sided with his accusers; leftist French writers, we are told, consider him too vulgar to be worth standing up for; even his own publisher Flammarion has distanced itself from him. Meanwhile, in a parallel trial by media, he has been accused of being a self-publicist and a poseur. He lives in a remote part of Ireland and plainly prefers a reclusive life, but, according to the press, he is only doing this for tax reasons. In short, he has been painted as some sort of opportunistic weirdo. His high literary reputation and huge popularity in France notwithstanding, this attack, and not the Islamic one, is likely to do him real, long-term damage.

The accusations against him turn out to be ridiculously slight. Last year, in an interview published in Lire magazine, Houellebecq called Islam "the dumbest religion" and compared the Koran unfavourably to the Bible which "at least is beautifully written because the Jews have a heck of a literary talent". This generalisation may raise one or two non-Muslim hackles: what, all Jews? And are the Christian authors of the New Testament deliberately excluded from this ungainly compliment? But if an individual in a free society no longer has the right to say openly that he prefers one book to another, then that society no longer has the right to call itself free. Presumably any Muslim who said the Koran was much better than the Bible would then also be guilty of an insult, and absurdity would rule.

As to "the dumbest religion", well, it's a point of view. And Houellebecq, in court, made the simple but essential point that to attack people's ideologies or belief-systems is not to attack the people themselves. This is surely one of the foundation principles of an open society. Citizens have the right to complain about discrimination against themselves, but not about dissent, even strongly worded, impolite dissent, from their thoughts. There cannot be fences erected around ideas, philosophies, attitudes or beliefs.

Houellebecq's novel Platform has also been cited in the case. In the novel, the central character, also called Michel, learns that his father has been murdered by a Muslim man and, through the course of the book, makes a number of harsh and derogatory remarks about Muslims. It has been suggested that in these diatribes the author is getting even for difficulties in his private life. Michel Houellebecq's real name is Michel Thomas. He took his grandmother's surname after his mother married a Muslim and converted to Islam. In our personality-cultist age, in which a writer's biography is firmly believed to hold the key to the meaning of his novels, in which the fictionality of fiction is routinely called into question and novels are thought of as real life in disguise, this detail of Houellebecq's life will prompt, has prompted, many a loud "ah-ha!"

But, and again but. Anyone who cares about literature should, when such ah-has are heard, at once defend the autonomy of the literary text, its right to be considered on its own terms, as if the author were as anonymous as, well, the authors of the sacred texts. And within a literary text, it must be possible to create characters of every sort. If novelists can't depict Nazis or bigots without being accused of being Nazis or bigots, then they can't do their work properly. Platform, it has rightly been said, is a novel to go to if you want to understand the France beyond the liberal intelligentsia, the France that gave the Left such a bloody nose in the last presidential election, and whose discontents and prejudices the extreme right was able to exploit. Platform is a good novel and Houellebecq is a fine writer who writes for serious reasons and neither he nor his book deserves to be tarred and feathered.

His accusers claim to be acting in part out of their concern that in the post-9/11 atmosphere, Houellebecq's utterances and writings will increase antagonism towards Muslims in the west. In this they have miscalculated badly. It is not Houellebecq, but their assault upon the writer, that runs the risk of creating that backlash in these sensitive times. So this is a case that both sides have already lost. Michel Houellebecq's reputation has been damaged, and his Islamic adversaries have shown themselves, yet again, to be opponents of the rough-and-tumble world of free speech. Houellebecq's law-yers argued with considerable force that were the judgment to go against their client, the law of blasphemy would have effectively been reintroduced. As we await the judge's ruling, we can only hope he does not take so dreadfully retrograde a step.