In this three page forum post the issue under discussion drifted off topic into newline characters appearing in file names. I believe that the information is of wider interest but is difficult to find in the thread : https://forums.livecode.com/viewtopic.p ... 7&start=30. So here is a summary.
Unix allows almost any characters to appear in file names and probably folder paths. This means that as far as Unix is concerned a newline character is valid in a filename. Mac OS is based on unix and allows the newline character in file names. Unfortunately when Apple's Finder lists such a filename for display it represents the newline character as a question mark.
When Livecode's files command used in its default "short" version, a newline delimited list of file names is returned. If one of the filenames in the list originally contained a newline character then the files command splits the filename at the newline into two entries in the list that is returned. Any attempts to manipulate these entries in the list will result in a "can't find file" error because no such file exists.
This issue is discussed in bug report : https://quality.livecode.com/show_bug.cgi?id=23676
The solution is to only use the detailed-utf8 version of the files command
as the short version does not work in all cases and the long version has been depreciated.Name. The file name is URL-encoded. To reliably obtain the name use the detailed-utf8 outputKind and decode using the URLDecode function followed by textDecode. For example, textDecode(URLDecode(item 1 of tLine), "utf8").
I believe that all above implies that when renaming files only the
should be used as the simpler Rename command does not use URL encoding so does not deal with newline characters.put URL A into URL B
If you have read this far I expect you are thinking
. All I will say is that none of mine had until I discovered that five out of a collection of one hundred thousand images did and these five caused days of head scratching and no, I have no idea how these pesky characters were added in the first place.well none of my filenames have a newline in them
best wishes
Simon