es.exe is returning ? in place of emojis in the folder name

General discussion related to "Everything".
Post Reply
hardik
Posts: 19
Joined: Mon Sep 02, 2019 4:24 pm

es.exe is returning ? in place of emojis in the folder name

Post by hardik »

Considering a scenario wherein a folder is present under D drive bearing name as seen in the attachment named ActualFolderName. Then the command es.exe parent:"D:" returns the result as seen in the attachment named "Capture". Is there a way in which the actual folder name can be returned using the es command?

Any help regarding the above will be appreciated.

Thank you for the help.
Attachments
ActualFolderName.PNG
ActualFolderName.PNG (1.54 KiB) Viewed 8761 times
Capture.PNG
Capture.PNG (983 Bytes) Viewed 8761 times
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by NotNull »

How characters are shown is dictated by 2 factors:
1. codepage
2. font

1. Codepage
You need to select a codepage that contains the characters you want. No guarantee that this works as it might be possible that some chars are only in codepage 1 and others only in codepage 2.

Check the current codepage in CMD by issuing the command CHCP
Change the codepage to - for example - unicode by issuing the command CHCP 65001
More on CHCP


2. Font
The font you use in CMD must have support for these special characters (if it isn't in the font, it can't be shown).
Try Lucida Console.
You can change the font by right-clicking the CMD title bar and choosing Properties.


CMD has very limited support for unicode characters, so I have my doubts if you can make this work.
The good news: If you export the results to a file, it will be UTF8 encoded and thus have support for special characters.
(try: es.exe parent:"D:" -export-txt output.txt )
hardik
Posts: 19
Joined: Mon Sep 02, 2019 4:24 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by hardik »

Tried both changing the code-page and using different fonts, but none of them worked.
Any plans of having this feature (Everything itself returning the emoticons in file and folder name instead of question marks) as a part of next release?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by NotNull »

Did you understand anything of what I wrote *at all* ?

ES.exe is not the problem; the console (host) is. It has very limited support for showing special characters.
(all input and output of ES.exe is handled by the console host).

And as you didn't mention which (emoji) characters, I would say:
What you want is not possible. Get over it.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by void »

Currently, there's no console font that supports the Unicode emoji plane.

Even the DIR command is unable to output the correct filename.
hardik
Posts: 19
Joined: Mon Sep 02, 2019 4:24 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by hardik »

Thanks for the information @void.

When I had tried using the Everything SDK, I was able to retrieve proper emojis in names of files and folders. However, for few other emojis, the SDK returned the unicode characters instead.

I tried the same by using es commands that run through command line but got question marks instead (as discussed previously).

Is there any encoding format being used in SDK that is facilitating the viewing of emojis?
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by void »

The SDK uses UTF-16 (Unicode).
Please make sure you use the SDK functions ending with W (Wide Characters) and not the functions ending with A (ANSI)

Two UTF-16 characters might be required to store some Emoji characters (unicode values >= 0x10000).

eg:
😀
is stored as two UTF-16 characters (surrogate pairs):
0xd83d 0xde00

It's up to the caller on how these characters are displayed.
waffeln
Posts: 25
Joined: Wed Dec 29, 2021 11:35 am

Re: es.exe is returning ? in place of emojis in the folder name

Post by waffeln »

I have a probably related issue:
I have this command:

Code: Select all

es.exe Baianá /ad
When i run this in Powershell, i get the correct result "D:\Library\Bakermat\Baianá"
However, when i run this in Node.js's child_process module with execFile it turns out like this "D:\Library\Bakermat\Baian�".
I'll try to come up with a method where i use one of the parameters to export to a file, but it's a bit complicated because of the way i call es.exe.
Is there anything i can try to get the encoding working? I've already tried the iconv-lite package to no result.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: es.exe is returning ? in place of emojis in the folder name

Post by void »

Node.js execFile passes arguments as UTF-8.

Please try calling a bat file to set the active code page to UTF-8 and then calling ES.

es.bat:

Code: Select all

CHCP 65001
es.exe %*
waffeln
Posts: 25
Joined: Wed Dec 29, 2021 11:35 am

Re: es.exe is returning ? in place of emojis in the folder name

Post by waffeln »

That worked, awesome!

From testing it looks like i only need to call this once in my code to make all subsequent execFile calls work.
I have no idea why or how this transfers or why this is even possible with the supposedly shell-less execFile but it works, so i'll just go with it.

This is great because i don't have to use -export-txt anymore and then read the file which should improve performance by quite a bit!
Post Reply