If you need samples of the folders i can forward a link for you to test
I'm not sure how to
visualize a file name that contains a trailing space(s) (or other non-printable characters)

?
Find them, yes, but how to
see?
Similarly, when you copy files from a foreign system to Windows, what copy method are you using that allows the creation of file names with illegal characters to be created (on the Windows end)? Wouldn't the copy operation either abort, or truncate, or replace the illegal characters?
In the 7-zip case,
extracting from an archive is essentially a copy operation.
And for trailing (.), 7-zip substitutes a _ in its' place. (Might do similar with other illegal characters?)
My file manager will not allow creation of an illegally named file.
My download manager will... oh, not quite sure, maybe something like, may either truncate or silently remove (may depend on the particular character in the downloaded file name) illegal characters. (Yes, it can create long directory structures [easily > 260 chars, but with some limitations too - in which case it will require you to shorten the length prior to the download proceeding] that will thwart many Windows utilities, but that is relatively easy to overcome - after the fact.)