I am reading the .NET IL Assembler book. There is a quote of the book:
`ldstr` "Enter a number"is an instruction that creates a string object from the specified string constant and loads a reference to this object onto the stack. The string constant in this case is stored in the metadata. You can refer to such strings as common language runtime string constants or metadata string constants. You can store and handle the string constants in another way, as explained in a few moments, butldstrdeals exclusively with common language runtime string constants, which are always stored in Unicode (UTF-16) format.
I see author writes that it is possible to refer to the string either as common language runtime string constant or as metadata string constant. While I do not understand the difference between these options, but my question is about something else...
Also, author writes twice about the using of the string by the ldstr instruction and everytime it is other (I selected it by the bold font).
So which type of the constant does the team use? Is it common language runtime string constant? Or is it metadata string constants?
I've done some research on this for the last couple of days and came up with a possible answer.
The book .NET 2.0 IL Assembler seems to use the same Example as your book. They talk about that the instruction
loads the constant "Enter a Number" into the metadata. Same as your example it states that it can be called either common language runtime string constants or metadata string constants, it seems to make no difference in this case. As for my understanding it just plain says that the string constant is formatted in UTF-16. If you'd want to use strings in ANSI formatting, you'd have to use placeholders. (Which I can't explain since I'm new to the topic too).
So my conclusion for this problem was that it simply comes down to the UTF-16 encoding of the metadata.