So I was doing some reading in Wikipedia on Napolean and what struck me was that Napolean was said to have been fond of Muhammad even to the extent of defending him against Voltaire's play.
Could somebody elaborate on how Napolean might have read about Muhammad and his unorthodox view on Muhammad given that he lived in a time where Catholicism was pretty much opposed to Islam .
You might want to check out Juan Cole's book on Napoleon in Egpyt; there are a few other recent books that deal or at least address this same issue but their names are escaping me right now and I'm far from my office.
The love Napoleon had for Islam and Mohammad arises during his invasion of Egypt. The affair is really centered around attempts to find similarities between Islam and French Revolutionary society. If it sounds a little far fetched, it ultimately was- that said, it wasn't really an unusual mental exercise. During the invasion of Egpyt and especially the occupation of Cairo, Napoleon made a pretty big deal about being a friend to Islam and looking for ways in which his troops and him weren't that different than the Muslim population. Obviously this didn't go over well the the Coptic Christian minority who naturally thought Napoleon might have had more in common with them, nor did it really convince a whole lot of the Muslim population, who saw in Napoleon just one more foreign conqueror in Egypt. There were even rumors that Napoleon was planning to convert or have his army convert, though nothing of the sort ever happened. Again the rumors came from the generally pro-Islam rhetoric of Napoleon and the fact that his army had conquered Malta and effectively ended what was left of the Knights of Malta on their way to Egypt.
So what was his actual relationship to Islam? I suppose that's hard to say- but more recent historians have tended to paint the whole thing in a very political light. As in, Napoleon dabbled with Islam under the impression that he could win the 'hearts and minds' of the population that he believed he had just freed from ottoman oppression. Really though, the republican virtues that he carried to Egypt as part of the French Revolution, were profoundly anti-religion and so they did not meld well Muslim egpytian life. I think historians tend to believe that either Napoleon did not really study much of Islam, didn't pay as much mind to the savants he brought with him who did study it, or just completely misunderstood/miscalculated the religion and Egyptian society as a whole. Either way his embrace of Islam and Mohammed was not born out of any real adoration or faith in the religion and instead the product of his political ambition.
So short answer to your question: he invades Egpyt which gave him plenty of chances to become familiar with Islam and even brings with him a bunch of academics to study Egypt and Islam among other subjects (which is why Edward Said points to this event as being fundamental in the construction of orientalism in the west).
Even without the invasion thought, France had long contacts with the levant and had been allies of the Ottoman Empire for quiet some time. So it's not like Islam and general knowledge of the religion was unknown, especially in the southern ports of France.