The closest thing to a universal convention (in the sense that it can be applied to any kind of text file, not necessarily universal adoption) that I know of is Emacs’ file-local variable declarations:
-*- coding: cp437 -*-
This was first released in GNU Emacs in Emacs 20.1, released in 1997. It may have existed earlier in MULE.
The vim editor has a similar feature, called modelines:
vim:set fileencoding=cp437
This was introduced in Vim 5.2, released in 1998.
However, I can see some materials on the Web claiming that the latter does not work particularly well for encodings. I don’t actually use either editor daily, so I cannot say anything about that.
I am also not immediately able to say how old those conventions are, but bothBoth served as inspiration for the Python encoding declaration standard, PEP 263, adopted in 2001, which I guess is just barely old enough to count as ‘retrocomputing’ here.