CEP showOpenDialog() issue with special characters on filename on Mac

Explorer ,
Jan 06, 2021

Copy link to clipboard

Copied

Hey,

I'm using CEP to create a PPro extension. In my panel I use showOpenDialog to let the user select a file from the filesystem:

 

 

 const file = window.cep.fs.showOpenDialog()

 

 

I selected a file called "münchen.mp4",  this is what I get on the file variable

 

on Mac:

 

 

on Windows:

 

image.png

 

I general, it seems that every char in a filename that is not ASCII is encoded into some code on Mac machines.

 

Any ideas how can I solve it? and have same behaviour on both Windows and MacOS

If you use showOpenDialogEx(), you'll get the expected characters. Here's CEP HTML Test Panel 1, running in PPro:

 

Screen Shot 2021-01-06 at 8.07.59 AM.png

TOPICS
Error or problem, How to, SDK

Views

44

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

CEP showOpenDialog() issue with special characters on filename on Mac

Explorer ,
Jan 06, 2021

Copy link to clipboard

Copied

Hey,

I'm using CEP to create a PPro extension. In my panel I use showOpenDialog to let the user select a file from the filesystem:

 

 

 const file = window.cep.fs.showOpenDialog()

 

 

I selected a file called "münchen.mp4",  this is what I get on the file variable

 

on Mac:

 

 

on Windows:

 

image.png

 

I general, it seems that every char in a filename that is not ASCII is encoded into some code on Mac machines.

 

Any ideas how can I solve it? and have same behaviour on both Windows and MacOS

If you use showOpenDialogEx(), you'll get the expected characters. Here's CEP HTML Test Panel 1, running in PPro:

 

Screen Shot 2021-01-06 at 8.07.59 AM.png

TOPICS
Error or problem, How to, SDK

Views

45

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 06, 2021 0
Explorer ,
Jan 06, 2021

Copy link to clipboard

Copied

on Mac:

 

image.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 06, 2021 0
Adobe Employee ,
Jan 06, 2021

Copy link to clipboard

Copied

If you use showOpenDialogEx(), you'll get the expected characters. Here's CEP HTML Test Panel 1, running in PPro:

 

Screen Shot 2021-01-06 at 8.07.59 AM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 06, 2021 0
Explorer ,
Jan 06, 2021

Copy link to clipboard

Copied

Thanks, it does work partially - now I do see the string as I expect to see (visually) but look at this:

 

dpt12_0-1609962652923.png

 

mediaName is the fileName returned from showOpenDialogEx()

currentChild.name is the filename taken from ProjectItem from the Bin (after I imported it)

 

my problem is that the underlying encoding seems to be different in both cases. So I cannot check the equallity between them (the above returns false although they both refer to the same video file).

 

Is there a way to overcome this? set the encoding?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 06, 2021 0
Adobe Employee ,
Jan 06, 2021

Copy link to clipboard

Copied

Sorry, that's outside my PPro and Adobe API experience. Yes, the encoding is suspect.

This seems potentially helpful/relevant:

https://salesforce.stackexchange.com/questions/57738/how-to-decode-german-charactersgerman-umlauts-f...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 06, 2021 0