J.:
Layer name restrictions are listed on p. 263 of my Release 11 "AutoCAD
Reference Manual". Page 334 offers a little bit of information on attribute
tags.
Briefly: layer names can be up to 31 characters long, and AutoCAD converts
'em to uppercase automatically. Letters, numbers, and the three special
characters $, -, and _ are valid characters. One caveat: XREF Attach
followed by Bind can add up to 11 characters to the name of a layer in an
external references (FILENAME$0$). I'd limit layer names to 20 characters
in order to avoid xref errors. Also be aware that many users don't
appreciate long layer names. Of course your application should handle
layers automatically, but there always seems to be a time when you end up
having to type a layer name.
According to the ARM, attribute tags allow "any characters except blanks",
but I think they mean *printable* characters. Tags, too, are converted to
uppercase automatically.
– Mark M.