• Invisible zero-width characters in file names

    From nospam@nospam@de-ster.demon.nl (J. J. Lodder) to uk.comp.sys.mac on Wed Apr 22 14:18:24 2026
    From Newsgroup: uk.comp.sys.mac

    I have two files in one folder with exactly the same name.
    (as far as the eye can see)
    This is of course impossible, and indeed,
    copy/pasting the name of one onto the other results in a Finder error.
    (file name already exists)
    File Buddy does not flag the names as identical.

    So there must be something invisible there.
    Stepping through the name does not reveal a surplus character,
    so it isn't a zero-width extra space. (have had that in another name)
    What else can there be? A non-ACII space or something like that?

    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    Jan

    [1] There is a partial solution in (of all places) MacSoup
    A zero-width invisible character (to the Finder)
    copy/pastes into MacSoup as a"0"b" .
    No idea what this accented i represents.






    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From richard@richard@cogsci.ed.ac.uk (Richard Tobin) to uk.comp.sys.mac on Wed Apr 22 12:42:21 2026
    From Newsgroup: uk.comp.sys.mac

    In article <1rtvrjq.mondcgi81xtvN%nospam@de-ster.demon.nl>,
    J. J. Lodder <jjlxa32@xs4all.nl> wrote:
    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    Does "ls -B" show it?

    Otherwise a short C program using readdir() should do the trick.

    -- Richard
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Alan B@alanrichardbarker@gmail.com.invalid to uk.comp.sys.mac on Wed Apr 22 12:46:30 2026
    From Newsgroup: uk.comp.sys.mac

    J. J. Lodder <nospam@de-ster.demon.nl> wrote:
    I have two files in one folder with exactly the same name.
    (as far as the eye can see)
    This is of course impossible, and indeed,
    copy/pasting the name of one onto the other results in a Finder error.
    (file name already exists)
    File Buddy does not flag the names as identical.

    So there must be something invisible there.
    Stepping through the name does not reveal a surplus character,
    so it isn't a zero-width extra space. (have had that in another name)
    What else can there be? A non-ACII space or something like that?

    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    Jan

    [1] There is a partial solution in (of all places) MacSoup
    A zero-width invisible character (to the Finder)
    copy/pastes into MacSoup as a"|!"b" .
    No idea what this accented i represents.

    According to <https://ss64.com/mac/ls.html>

    ls -b
    --
    Cheers, Alan
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From richard@richard@cogsci.ed.ac.uk (Richard Tobin) to uk.comp.sys.mac on Wed Apr 22 13:05:41 2026
    From Newsgroup: uk.comp.sys.mac

    In article <10safnd$mq4f$1@artemis.inf.ed.ac.uk>, I wrote:

    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    Does "ls -B" show it?

    Otherwise a short C program using readdir() should do the trick.

    Also "LANG=C ls" will display non-ascii bytes as "?".

    -- Richard
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From nospam@nospam@de-ster.demon.nl (J. J. Lodder) to uk.comp.sys.mac on Thu Apr 23 21:53:53 2026
    From Newsgroup: uk.comp.sys.mac

    Richard Tobin <richard@cogsci.ed.ac.uk> wrote:

    In article <1rtvrjq.mondcgi81xtvN%nospam@de-ster.demon.nl>,
    J. J. Lodder <jjlxa32@xs4all.nl> wrote:
    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    Does "ls -B" show it?

    Otherwise a short C program using readdir() should do the trick.

    I'll try. But somehow I had hoped for a direct solution,
    like 'show invisibles' does in Finder,

    Jan



    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From richard@richard@cogsci.ed.ac.uk (Richard Tobin) to uk.comp.sys.mac on Thu Apr 23 20:02:12 2026
    From Newsgroup: uk.comp.sys.mac

    In article <1ru1fsf.1ocbqddwjhpxiN%nospam@de-ster.demon.nl>,
    J. J. Lodder <jjlxa32@xs4all.nl> wrote:

    Does "ls -B" show it?

    Otherwise a short C program using readdir() should do the trick.

    I'll try. But somehow I had hoped for a direct solution,
    like 'show invisibles' does in Finder,

    I find typing "ls -B" a lot more direct than using the finder!

    -- Richard
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bruce@07.013@scorecrow.com to uk.comp.sys.mac on Sat Apr 25 21:41:23 2026
    From Newsgroup: uk.comp.sys.mac

    On 22/04/2026 13:18, J. J. Lodder wrote:
    I have two files in one folder with exactly the same name.
    (as far as the eye can see)
    This is of course impossible, and indeed,
    copy/pasting the name of one onto the other results in a Finder error.
    (file name already exists)
    File Buddy does not flag the names as identical.

    So there must be something invisible there.
    Stepping through the name does not reveal a surplus character,
    so it isn't a zero-width extra space. (have had that in another name)
    What else can there be? A non-ACII space or something like that?

    Is there a simple tool that will reveal non-ASCII characters
    in file names? [1]

    As others have pointed out, the "ls -B" command run in the terminal will
    force any invisible characters to be visible.

    An alternate solution is just rename one of the two to "filea" and the
    other to "fileb" to get rid of all previous characters in the filename,
    funny or not, and then rename each back to what its actual name should
    have been.


    Jan

    [1] There is a partial solution in (of all places) MacSoup
    A zero-width invisible character (to the Finder)
    copy/pastes into MacSoup as a"|!"b" .
    No idea what this accented i represents.

    Regards,
    --
    Bruce Horrocks
    Hampshire, England
    --- Synchronet 3.21f-Linux NewsLink 1.2