I'll second most of goodguy5's answer:
Rules As Written
By RAW, it is unclear, since part of the copying clearly refers to understanding the spell itself.
Rules As Intended
RAI, you should know which spells are in the spellbook, since some interactions would make no sense as he exemplified with trying to copy a spell that you don't have spell slots to.
Note that the entire process takes 2 hours and 50 gold per spell level, so, no matter what, it shouldn't be intended that only knowing which spell it is would take the same time and cost the same gold.
Rules As Fun
Now this is where I will make some changes in goodguy's answer. I'm sorry if it becomes a heavily opinion-based answer, but it is kinda based on experience. As a mainly Wizard player, I don't find it that fun to just receive a Spellbook with "X, Y, Z" spells on it and choose which I want to copy and that's all. I actually enjoy the mystery on someone else's Spellbook, his awkward notations that don't make any sense to me, why does he use \$ y'\$ instead of \$ \frac{dy}{dx} \$?!?! This Evil Wizard clearly knew no math, god. Obviously, "Spend 2hr and 50 gold per spell level" is not a funny solution either. Jokes aside, it is completely fine that an easy spell like Magic Missile would be understood instantly, but all those diagrams to this Wish spell?
Here are some things I've thought would be fun as a Wizard player:
- Make use of the Arcana skill. Most Wizards have it, and Intelligence skill checks are already too much in the shadows, at least in my tables.
- Even if you decide to put a roll on it, never make it so a bad roll will incapacitate your wizard from learning what that spell was - it will just take him some time studying. This time should be, at most, the 2hr per spell level. I don't see any reason for charging gold, as he is just studying. (I always interpreted the gold cost as the special Ink and w/e I was using to copy it and maybe some materials for experimentation to actually learn how to cast it).
- If there is an amazing spell that you know certainly your player wants, maybe a quick side quest involving Libraries and Arcane Knowledge where he learns the archaic magic notation from the society that created this spell?
- If you are DM'ing, ask your player(s) what would be the funniest for him(them).
Per suggestions, I would like to note that I tried using the Arcana skill for it as a DM (trying to improve something I didn't like when I was a player). I talked with the player that was going to play Wizard beforehand to make sure he didn't mind losing some character hours studying, and if he did I would just make him know the spells on the book and that's all. But he didn't and enjoyed the extra flavor on it.
The system worked like this:
- Based on the level of the spell, which I would indicate to the player through how complex it looked in the book, I set a DC. (Note: some remarkably good spells would have a DC higher than the others at the same level, and the contrary for bad ones.)
- If he passed the test, he identified the spell, remembering he saw these symbols elsewhere and making trivial to understand which spell it was.
- Here I should note that passing this test would also decrease the time to copy it to your book. IIRC I've used 1hr per spell level.
- If he failed, depending on how hard he failed, it would take him something in the range from 1hr to the standard 2hrs per spell level. If he then wanted to copy it to his book, he only needed to pay the 50g per spell level.
So the trade-off from the actual system is: he would take less time to copy a spell that he wanted to copy (from 1hr to 2hr/spell level, instead of always 2hr/spell level), but sometimes he would have to study before even knowing which spell it is, and if he didn't want it, it was "lost time".