Multilingual environment and our file storage on linux of course allows all those international (Asian) characters in filenames. But this is causing problems syncing to other systems because the international characters all get treated by the other systems as ??? or something, and they are no longer unique filenames to those systems (culprit is MS Onedrive/Sharepoint that we're trying to sync to) -- two files in the same directory with different names (Asian characters) but having the same number of characters get treated as having identical file names, unfortunately, and we get a copy error. There seems to be no workaround except renaming files.
I want to simply append the files' own datetimes in ASCII to their filenames and this should solve it.
This command works beautifully for finding all the files that are 'problematic' for me, so to speak -- it locates all non-ASCII characters in file and folder names in /path/to/files/ and all subfolders:
find /path/to/files/ | grep -P "[\x80-\xFF]"
What I need to do with those files is append the base file name with the file's own datetime in ASCII (leaving file extension alone, as is).
Pretty much any datetime would work, either the birth, modify, change date as per stat. The information returned by these would work, for example:
stat -c '%y' filename
date -r filename
I can't figure out how to automatically append these datetimes for the files to the base filenames of the files listed by that first find command.