The world really needs an edition of homoerotic tales from the Arabian Nights. Androphile.org has a few, centering on the 8th century Islamic rake and poet Abu Nawas. My book of selected stories, a battered 1959 hardbound edited by Bennett A. Cerf, has The Third Kalandar's Tale, which, in part, details the trials of a king stranded on an island.
But while I was pondering my case and longing for death behold, I saw afar off a ship making for the island; so I clomb a tree and hid myself among the branches. Presently the ship anchored and landed ten slaves, blackamoors, bearing iron hoes and baskets, who walked on till they reached the middle of the island.
[They dig up a trapdoor and open it, then return to the ship for food, furniture, decorations, and other household goods, and put them underground. An old man disembarks, escorting a young man:]
And the Shaykh held by the hand a youth cast in beauty's mould, all elegance and perfect grace; so fair was he that his comeliness deserved to be proverbial; for he was as a green bough or the tender young of the roe, ravishing every heart with his loveliness and subduing every soul with his coquetry and amourous ways...
[They bury the boy in the underground dwelling.]
When they turned away to depart, I came down from the tree, and going to the place I had seen them fill up, scraped off and removed the earth; and in patience possessed my soul until I had cleared the whole of it away. Then appeared the trap-door which was of wood, in shape and size like a millstone; and when I lifted it up it disclosed a winding staircase of stone. At this I marvelled and, descending the steps till I reached the last, found a fair hall, spread with various kinds of carpets and silk stuffs, wherein was a youth sitting upon a raised couch and leaning back upon a round cushion with a fan in his hand and nosegays and posies of sweet scented herbs and flowers before himl but he was alone and not a soul near him in the great vault. When he saw me he turned pale; but I saluted him courteously and said, "Set thy mind at ease and calm thy fears; no harm shall come near thee; I am a man like thyself and a King to boot; whom the decrees of Destiny have sent to bear thee company and cheer thee in thy loneliness. But now tell me, what is thy story and what causeth thee to dwell thus in solitude under the ground?"
When he was assured that I was of his kind and no Jinni, he rejoiced and his fine colour returned...
[The boy explains that he is his elderly father's only child, but that a prophecy foretold he would live fifteen years only to be killed by a man named Ajib, son of King Khazib. This man was also fortold to shoot down the horseman of yellow laton on top of a mountain of magnet, already accomplished earlier in the story. Of course, our hero is Ajib himself, reported drowned- the boy's father will come back in thirty days to fetch him, with the assumption that Ajib is dead for sure and no longer a threat. Ajib does not declare himself, but swears an oath not to harm the boy- indeed, to serve him and keep him company until the time is over, at which point he'll ask the boy's father for an escort to his own kingdom. The boy is glad, they eat dinner, and go to sleep.]
Next morning I arose and warmed a little water, then lifted him gently so as to awake him and brought the warm water wherewith he washed his face and said to me, "Heaven requite thee for me with every blessing, O youth! By Allah, if I get quit of this danger and am saved from him whose name is Ajib bin Khazib, I will make my father reward thee and send thee home healthy and wealthy; and, if I die, then my blessing be upon thee." I answered, "May the day never dawn on which evil shall betide thee; and may Allah make my last day before thy last day!" Then I set before him somewhat of food and we ate; and I got ready perfumes for fumigating the hall, wherewith he was pleased. Moreover I made him a Mankalah-cloth; and we played and ate sweetmeats and we played again and took our pleasure until nightfall, when I rose and lighted the lamps, and set before him somewhat to eat, and sat telling him stories till the hours of darkness were far spent. Then he lay down to rest and I covered him up and rested also. And thus I continued to do so, O my lady, for days and nights and affection for him took root in my heart and my sorrow was eased, and I said to myself, The astrologers lied when they predicted that he should be slain by Ajib bin Khazin: by Allah, I will not slay him. I ceased not ministering to him and conversing and carousing with him and telling him all manner takes for thirty-nine days. On the fortieth night the youth rejoiced and said, "O my brother, Alhamdolillah!-praise be to Allah- who has preserved me from death and this is thy blessing and the blessing of thy coming to me; and I prayed God that He restore thee to thy native land. But now, O my brother, I would thou warm me some water for the Ghusl-ablution and do thou kindly bathe me and change my clothes." I replied, "With love and gladness;" and I heated water in plenty and carrying it to him washed his body all over, the washing of health, with meal of lupins and rubbed him well and changed his clothes and spread him on a high bed whereon he lay down to rest, being drowsy after bathing. Then said he, "O my brother, cut me up a water-melon, and sweeten it with a little sugar-candy." So I went to the store-room and bringing out a fine water-melon I found there, set it on a platter and laid it before him saying, "O my master hast thou not a knife?" "Here it is," answered he, "over my head on a high shelf." So I got up in haste and taking the knife down from its sheath; but my foot slipped in stepping down and I fell heavily upon the youth holding in my hand the knife which hastened to fulfil what had been written on the Day that decided the destinies of man, and buried itself, as if planted, in the youth's heart.
Of course the same sex relationship is not the main point of the story, but that it appears so casually in a group of stories holds cultural significance. Later in the same story Ajib finds a palace with forty beautiful maidens in it, with much the same enthusiasm, but a different moral.