Sending cd message from external program & Unicode?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Sending cd message from external program & Unicode?

Post by *m^2 »

Hey Christian,
I have a question. Currently programs send cd command by wm_copydata. Can we somehow pass Unicode path this way?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50923
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, you need to send the cd command as usual, but in front of the path you must send the 3 byte UTF-8 BOM (byte order marker, EF BB BF hex) and then the path in UTF-8.

You need to do this for the left and right side separately. I recommend that you send the path in ANSI except when it contains Unicode (so the conversion to ANSI creates '?' characters). This way you keep compatibility with older TC versions.
Author of Total Commander
https://www.ghisler.com
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

ghisler(Author) wrote:Yes, you need to send the cd command as usual, but in front of the path you must send the 3 byte UTF-8 BOM (byte order marker, EF BB BF hex) and then the path in UTF-8.

You need to do this for the left and right side separately. I recommend that you send the path in ANSI except when it contains Unicode (so the conversion to ANSI creates '?' characters). This way you keep compatibility with older TC versions.
Thank you for the answer.
User avatar
Dalai
Power Member
Power Member
Posts: 10035
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:Yes, you need to send the cd command as usual, but in front of the path you must send the 3 byte UTF-8 BOM (byte order marker, EF BB BF hex) and then the path in UTF-8.
Could you post a working example, e.g. in Delphi? So far I only have code that works for ANSI.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Dalai wrote:Could you post a working example, e.g. in Delphi? So far I only have code that works for ANSI.
There are a lot of examples within forum, e.g. here.
User avatar
Dalai
Power Member
Power Member
Posts: 10035
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

:oops: I read some of the threads that came up in a search for "WM_COPYDATA", but I didn't look into that thread. Thanks. I will try that code.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply