I just read a book about homosexuality in Ottoman Empire. It turned out homosexuality was pretty common in Ottoman Empire. There were male sex workers, poems written by males about another man's beauty ext. I talked about it with my friend and he said "I dont know about the Ottomans but I know Persians learned homophobia from Europe." Is it true?
Ooh, I have been summoned!
This is a bit of a pet topic for me; Medieval and Early Modern LGBT issues. I'm more on the Early Modern side in speciality, but I digress.
The basic element you need to understand about the historical European conception is twofold. First, sexuality is often intertwined with issues of politics, money and status and proper gendered behaviour generally, and secondly, the concept of "sodomy" the closest understanding they have of the Bad Gays(tm) is imprecise and has multiple meanings. Sodomy can mean any "deviant" sexual behaviour, specifically anal sex, or specifically gayness and especially gay anal sex.
Because of the imprecision of definition and the focus on anal sex ,they don't necessarily understand or recognise gayness very well. And they aren't always as fussed about it if it doesn't include anal sex. That first aspect of intertwining with other issues is relevant. If a relationship was considered damaging or status-subversive it was much more likely to be objected to, and to be recognised as sodomy, even to the extent that it was libelled against those who weren't because it was a way of portraying a relationship as unhealthy. But because "sodomites" are understood as perverted (as in unnaturally corrupted) people, you were not really supposed to recognise them as a distinct and consistently existing thing. People kind of knew that some people were like that, but it wasn't talked about all that much, and it was generally expected to be preventable. As a result, oddly, the intensely homophobic era of the Late Medieval and Early Modern Periods were also not very well aware of, or even always willing to acknowledge the object of their distaste; they preferred to pretend it didn't exist.
I did an answer on sort of this topic before that goes more into depth, with sources, on the European view:
There is a distinction to be made between the Early Medieval and Late Medieval. During the High Medieval and the Late Medieval there was a transition between an attitude that was more on the ignorance and ambivalence side, to one that was more active in recognising and persecuting sodomy.
The Quran also includes provisions against homosexuality like the Old Testament, which are similarly understood to refer to anal sex in particular. Ar-Razi in the 9th/10th century wrote a text that describes a form of submissive homosexuality as a medical condition, referred to as ubnah. Like European sources, the particular focus is on the degeneracy and gender-subversiveness of a man receiving anal sex. Interestingly, this is actually earlier than many of the European texts in specifically acknowledging the existence of gayness and discussing it somewhat explicitly, even apologising for its bluntness. This source is also sympathetic however, suggesting it as more naturalistic though divergent, and that it should be treated, with no mention of punishment. It also doesn't seem to preclude sexual activity with men in general.
Bruce Dunne ("Homosexuality in the Middle East", 1990) points out that this attitude where the dominants were largely accepted and the submissives more shameful but tolerated to some degrees was common in the Ottoman Empire. In particular this dynamic and it's acceptance was common in the upper-class world. In the Islamic world it appears to have become harsher over time like in Europe; as he points out Ibn-Sana and Ibn-Hubal were less sympathetic than Ar-Razi. These writers, including Ar-Razi, are all Persian but their attitudes were applied in the Ottoman Empire later and it shows the Persians did not "get it from the Europeans" either. They were building up similar developments in attitude at around the same time as Europeans and deriving it from the Quran and medicine. if anything the Europeans could be said to have gotten it from such Persian writers, for example Ibn-Sana was widely distributed as "Avicena" (his Latinate name) Bruce Dunne does suggest however that Christian and Jewish converts may have increased pressure on the development in homophobia, especially he says as a way of proving their religious discipline and originalism. Penalties for homosexuality could be a thing in the Medieval Islamic world, though rarely applied (Jelena Čvorović, "Islamic Homosexuality", 2006).
A lot of the strongest suggestions of widespread homosexuality are from distinctly biased European observers who give very dramatised accounts. Stephen O' Murray (Homosexuality in the Ottoman Empire) notes that many of the male observers from the 16th, 17th and 19th centuries did not have access to particularly good information. The element of same-sex poetry in the Ottoman Empire is fairly well established though. Similarly there was the distinctly pederastic tradition of dancing boys, although it was considered shameful to use a good Muslim boy this way, so a foreign slave was used. Murray in "Homosexuality Among Elites in Ottoman Turkey" (1997) notes that the boy pages were watched to prevent "lewd" behaviour between them, although such activity with the Sultan if he asked for it was more acceptable.To further deal with Persia, Najime Katami (Persian painting: a visual window into a genderless language, 2013) also attributes more homophobic strains in society primarily to Islam, not Western influence.
Sorry, this is a little rambly. In conclusion the Middle-Eastern Islamic view of same-sex activity— while slightly more accepting— and with a stronger sense of the Greco-Roman pederasty model, was not radically different from Europe. They did not get the more homophobic elements of their culture from Europe, except as a smaller influence. And from what I can tell, admittedly not all too informed about the Islamic side of things, there doesn't appear to be much of a difference between Persian and Ottoman despite their famous territorial and religious rivalry during the Late Medieval and Early Modern Period. Indeed, the Ottomans derived some influence from Persian culture.