You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Hidden characters in exported image filename

When exporting Keynote slides as images some hidden characters are added to the filename. In this case a question mark (?) is added as the first character in the file name and also after the period. These characters are not visible in the Finder window, they are only visible when doing an "ls" from Terminal. See attached screen shot.


Colleagues have been able to replicate the behavior on their M1 MacBook Pros running the same version of Keynote 13.1 (7037.0.101).


Any ideas on why this is happening? I can verify this was not happening with earlier versions of Keynote.


MacBook Pro (M1, 2020)

Posted on Jul 21, 2023 10:27 AM

Reply
5 replies

Nov 29, 2023 9:15 PM in response to smgraham7

The "\u200E" character you find at the beginning of each word in a file exported from Keynote is usually a control character called "Left-to-Right Mark". This character is used to indicate the direction of the text in the language, i.e. that the text should be read from left to right.

The problem with this character in the file name is that it is not visible, it is a hidden character.

When being hidden you can find in a windows environment two images with the same name but that are different.

Another problem is that this name with hidden character is also seen by databases like SQLSERVER, and here the problem is that when using this name by the programs or querys we have errors and crashes in the apps that are not prepared to detect these hidden characters.


My solution has been to use ChatGPT to create a script to read the images that keynotes exports and clean them of hidden characters.



It's a simple problem for Apple to fix.

It's a problem that causes many bugs that sometimes remain hidden until you notice them.

A common bug is uploading photos to a WordPress with these hidden characters, you can go crazy to find the solution.

There are already many things that are better done from Windows than from Mac.

I hope I helped you, have a great day.

Atentamente JUAN LUIS MARTEL.

Jul 22, 2023 5:57 AM in response to smgraham7

I am naturally curious how an export of a image from Keynote results in embedded carriage return characters (?) in filenames on a UNIX system. Granted the Finder will allow anything but a colon in a filename, but macOS at the Terminal level does not. Also, it is not good form to have two periods in a filename in UNIX, though again, the Finder is oblivious.


In the Terminal, using the Zsh shell, you can clean up those filenames. Change into the directory location containing those bogus filenames. The ^M that you see below is actually the combination of ctrl-V and then ctrl-M and is a representation for a carriage return character in macOS.


autoload zmv
zmv '^M*' '${f//^M/}'


This basically says take any file in the current folder location that contains at least one carriage return character and rename the file without those unwanted characters in the name.


So ?test_images.?001.jpeg becomes test_images.001.jpeg.

Hidden characters in exported image filename

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.