You probably heard this story as a child, but in a different version. Here's the medieval original.
Illustration for the Hans Christian Anderson version of the story by Vilhelm Pederson, 1849.
In 1335, Sir Juan Manuel (1282-1348) sat down to write a book of tales to exemplify good and foolish behavior. He was a nephew of King Alfonso X the Wise of Castile, grandson of Saint Ferdinand III, King of Castile, and was himself Prince of Villena, among other titles. He had been well-educated as a youth and had spent his life involved in politics and the defense of the realm.
Although literature was deemed unworthy a man of his high estate, he became the first writer in Castilian to consider himself what we would call a professional writer, and he worked hard to perfect his works. He wrote a dozen books on topics ranging from chivalry and hunting to history and religion, but his best-known is El libro de los enxiemplos del Conde Lucanor e de Patronio (The Book of Examples of Count Lucanor and Patronio).
In that book, Count Lucanor asks his advisor Patronio for counsel about his problems and concerns, and Patrionio answers with short stories or fables — 50 stories in all. Some are drawn from Arabic folk tales or classical sources like Aesop, others are original.
Eventually these stories were translated into different languages, and they inspired future writers. Here is Example XXXII from El Conde Lucanor. The Count says that a man has proposed an important business matter that could be very advantageous, but insisted that it be kept secret. Patronio responds:
My lord Count Lucanor, so that you understand what I think would be best for you to do, I would like you to know what happened to a Moorish king when three rogues came to see him....
My lord Count, the three rogues came before a King and told him they were excellent master weavers. Their greatest skill was to make a cloth that could be seen by any man who was the son of his father as everyone believed, but the cloth could not be seen by a man who was not the son of the man everyone said was his father.
This seemed very good to the King, for by that means he would know the men in his realm who were the true sons of their fathers and who were not, and that way he could confiscate their estates and increase his own, because Moors did not inherit from their fathers if they were not truly their sons. To do that, he ordered the weavers be given a large hall so they could make the cloth.
They asked the King to order the hall locked until the cloth was finished so he could be sure there was no trickery. This also seemed very agreeable to the King. They were given a great deal of gold, silver, silk, and everything else they needed to make the cloth, and they entered the hall and were locked inside.
They put up their looms and seemed to spend all day weaving the cloth. After several days, one of them went to tell the King the cloth had been begun and it was one of the most beautiful things in the world. He described the patterns and decorations that they had begun to create and asked him, if it was his wish, to come and see it, but no one at all should accompany him. The King was pleased by all of this.
The King, to have someone else test himself first, sent his chamberlain, whom he did not think would be fooled. When the chamberlain saw the weavers and heard what they said, he did not dare to say that he could not see it. And so, when he returned to the King, he said he had seen the cloth. The King then sent another servant, who said the same thing. And since all those who had been sent by the King assured him that they had seen the cloth, the King went to see it.
He entered the hall and saw the weavers working while they said, "You can see this decoration here, and this pattern, and this figure, and this color."
And they all agreed about what they said, yet they had not woven anything. The King saw nothing and heard them describe the cloth, but he could not see it even though the others had. He felt frightened to death, believing that he could not see it because he was not the son of the man he thought was his father the king. He feared that if he said he could not see it, he would lose his kingdom.
Because of that, he praised the cloth and paid close attention to all the details that the weavers showed him. When he returned to his court and his courtiers, he began to speak wonders about how good and how marvelous that cloth was, and he described the figures and patterns that were in it, but he felt very unsure about himself.
After two or three days, he sent his governor to see the cloth and told him about the virtues and marvels that he would see in it. The governor went and when he entered, he saw the weavers working and describing the decorations and patterns of the cloth, but, since the King had said he could see it and the governor could not, he believed it was because he was not the son of the man he had held to be his father. He thought that if anyone found out, he would lose his honors, so he began to praise the cloth as much or more than the King had.
When he returned to the King and told him that he had seen the cloth and it was the most worthy and handsome thing in the world, the King felt even more disgraced, thinking that since the governor had seen the cloth and he had not, he had no doubts that he was not the son of the king, as he had believed. For that reason, he began to praise even more highly the quality and beauty of the cloth and the skills of those who had woven it.
The next day the King sent his favorite courtier, and the same thing happened to him. What more shall I tell you? This way, out of fear, the King and many in his land were fooled because none dared to say that he did not see the cloth.
And so the business continued until a big festival approached, and everyone told the King he should wear that cloth for the occasion. The weavers brought the cloth wrapped in fine linen sheets, and they acted as if they unrolled it, then asked the King what kind of outfit they should sew. The King described the kind of clothing he wanted. They measured him and acted as if they were cutting the cloth and sewing.
When the day of the festival arrived, the weavers brought the King the cloth, cut and sewn, and made him think they were dressing him and smoothing out the folds. When the King thought he was dressed, he did not dare to say that he could not see the cloth.
And clothed that way as you have heard, he mounted a horse to ride through the city. It was good for him that it was summer.
When people saw him coming dressed that way, they knew that he who could not see the cloth was not the son of the man he thought was his father. Everyone believed that although he did not see it, the rest could, and if he were to say so, he would be lost and dishonored.
That way the secret was kept and no one dared to reveal it until a black man, the King's horseman, who had nothing to lose, approached the King and told him, "My lord, it makes no difference to me if you think I am the son of the man I say is my father or someone else, and because of that, I tell you that either I am blind or you are naked."
The King began to insult him, saying that he could not see the clothes because he was not the son of the man he believed was his father.
But after the black man had said this, someone who had heard him said the same thing, and then others said so until the King and all the rest lost their fear and recognized the truth, and so they understood the trickery that the rogues had done. When they went to look for them, they did not find them, for they had left with everything they had gotten from the King by means of the trickery that you have heard about.
And so, Count Lucanor, since that man has told you that no one you trust should know what he has proposed, you may be sure that he wishes to trick you. You should realize that he has no reason to want your success, since he hardly knows you, while those who have lived with you have given and done much for you, because they will always want what is good for you and to serve you.