Low_Line char causes trouble in extension

Hello,
in fileTypes I used to have an item with extension “_myext” (shift minus). Creating a file with such extension I used to get the file (myfile._myext) with its proper icon.
Now I still get the file, but with a generic (white) icon.

I’m not sure if this behavior started happening when I built my app as 64-bit or after I installed Mojave.

Anyway, removing the “low line” solved the problem.
PS: googling for forbidden characters in extensions or files, “_” is not listed as a forbidden char.

Xojo version used to build the application ?

I have lost my documents icons years ago, both running my applications on mac OS and Windows (forgot the Linux status) years ago (and I do not use that character nor non ASCII ones).

BTW: did you try to remove the underscore character (and/or move its location to myfile.my_ext ?

Remember what Xojo use: Emile Schwarz.xojo_license :wink:
and the xojo binary extension also use an underscore character.

At last, the file extension start after the dot separator; so your extension is: _myext. (thus my advice)

Hi Emile,
the problem happens only if the “_” is part of an extension. And I’m using Xojo 2018r4.
Thanks.

[quote=431268:@Carlo Rubini]Hello,
in fileTypes I used to have an item with extension “_myext” (shift minus). Creating a file with such extension I used to get the file (myfile._myext) with its proper icon.
Now I still get the file, but with a generic (white) icon.

I’m not sure if this behavior started happening when I built my app as 64-bit or after I installed Mojave.

Anyway, removing the “low line” solved the problem.
PS: googling for forbidden characters in extensions or files, “_” is not listed as a forbidden char.[/quote]
In recent versions of macOS, you need to have fully implemented UTI parameters. For instance, if your app creates these files and “owns” the file type, it needs to be marked as “Exported” as opposed to “Imported”. The UTI Identifier should be set to the app Identifier + the file type ( formatted like this: com.yourcompany.mytext ) and the “Conforms to” value set to one of the base types from Apple. If your data truly is just text, this should probably be “public.text”.

Oh and don’t get discouraged if it doesn’t seem to work right away. macOS caches UTI Identifiers and it might take a little while to pick it up. Just make sure the version number you are working on is the highest on your machine and that you get rid of previous builds.

I usually use a virtual machine for testing because they can be reverted to a “clean state” so easily.

Nota:

After Greg answer, I get an eye on my app icons and realized that some applications have an icon. So, after all, it may be my fault if some others do not have one. I have to explorate why/how and apply the right method where it does not works.

If you cry when something (done by others) is wrong, apologize when it is your fault:
I am sorry.

@Greg O’Lone

Thank you Greg for answering. Actually everything was like you say, and it worked until last November when I moved to last Xojo (+64-bit) and Mojave. And I tested it booting as Guest and having the app tested by a friend.
I even tested adding the “_” char to the extension of another filetype that used to work, and voila, the icon became generic.

By the way, what is funny is that the UTI Identifier field does not accept “_” if one types it with Shift minus: it beeps; I had to copy-paste it. And by that I was inferring that maybe Xojo was alerting me that it would not work.

Anyway, the intention of this post was just to be a heads up so that if anybody uses “_” in his/her own project, may check whether their files get the intended icon.