Problem:

Mac OS 7 exchanging files with modern Windows always ends up with
file names and contents getting messed up. E.g. a BBEdit saved
file comes out as !TESTHTM.L, when it was saved as "test html".

Solution:

This is a direct result of the file-name mangling caused by
Apple's "PC Exchange" on classic 7.x systems.

Even though System 7.6 introduced long file naming with PC
Exchange, it only affects the contents of a DOS formatted
container on the Mac side. That is, at the Mac end, files that
you copy into a DOS formatted container (floppy or other
removable disk etc), still look correct.

But once you take them over to the Windows side you find that the
file names are in a DOS 8x3 naming convention. So your "test
html" gets all caps truncated and renamed with the first seven
characters plus a "!" to make up the eight characters as
"!TESTHTM" and the trailing period "." plus "L" for the 3 letter
suffix (it wouldn't surprise me if there were 2 spaces after the
"L" in that suffix).

Also of significance is your naming the file "test html", that
is, files going to a Windows platform need to have a period "."
and a three (sometimes four) letter suffix in the file name,
otherwise Windows won't know what the file is meant to be opened
with. It's not going to make sense of any file labeled with a
".L" suffix, is it?

If you had named the file "test.htm" or "test.html" the result on
the Windows side would be "!TEST.HTM". Not ideal, but at least
Windows would have been able to deal with it better.

If you want to get rid of the problem, within your Mac's Control
Panels, open the Extensions Manager and switch off PC Exchange to
disable it. Go to the Mac Garden and download DOS Mounter 95 and
install it. Reboot to use.

You'll find that either one of these will solve many problems WRT
file transfers between System 7 Macs and PC's. Long filename
support is built into both and work in both directions not just
at the Mac end. A file named "a_rather_long_name.htm" will arrive
at the Windows side as "a_rather_long_name.htm" - ditto in
reverse. That is, no file name mangling. Also, DOS Mounter 95/98
is very configurable for setting the file types as to how you
want them to arrive on your Mac. (view the screenshots on their
respective pages for those hints).

Apple's PC Exchange may have improved over the years, but in
System 7 OSs, it was still in its infancy and had obvious flaws.

Thanks to MikeTomTom for providing this tip!