The former must be correct, since the quote was not a question, and turning it into one would not be a fair quotation. Why should its status as a question change where we put the end of sentence marker?
The same argument applies to the period, since the quoted phrase may not have included one.
Note that both American and British usage put a question mark outside the quotation marks. Only periods and commas are placed within the quotation marks in American style.
It's not a "used to" thing. The British style introduces white space gaps that don't look good. It's like ending a sentence with a space .
> The former must be correct
IMHO, "correctness" in the sense of "here's exact the character string that occurred in that other document, and anything else is wrong," is kind of a programmer POV. A looser sense of correctness is perfectly fine.
> The British style introduces white space gaps that don't look good.
Sure they do, to me. The comma you inserted between the end of the quote and the closing quotation mark looks bad to me, because I have a strong expectation of the opposite. That esthetic feeling you have is how 'used to' manifests.
Also the US spelling of 'esthetic' is ugly to those expecting 'aesthetic'. I'm sure the British spelling looks pretentious to Americans.
“Aesthetic” is widely used in the US as well. When I (a US person) see “esthetic” used in this way, it looks like a mistake to me—I associate that spelling with the cosmetics/beauty industry (i.e., "estheticians").