UTF-8 locale brings unicode support into Altap Slamander

This is a place for users to discuss Altap Salamander. Please feel free to ask, answer questions, and express your opinion. Please do not post problems, bug reports or feature requests here.
finale
Posts: 2
Joined: 17 Oct 2020, 09:49

UTF-8 locale brings unicode support into Altap Slamander

Post by finale »

From https://en.wikipedia.org/wiki/Unicode_i ... ft_Windows article:
In April 2018 with insider build 17035 (nominal build 17134) for Windows 10, a "Beta: Use Unicode UTF-8 for worldwide language support" checkbox appeared for setting the locale code page to UTF-8. This allows for calling "narrow" functions, including fopen and SetWindowTextA, with UTF-8 strings. In May 2019 Microsoft added the ability for a program to set the code page to UTF-8 itself, and started recommending that all software do this and use UTF-8 exclusively.
With the UTF-8 locale enabled Altap Salamander 4.0 can work with multiple languages in file names. For example English, Russian and Hebrew simultaneously.
utf8_locale_windows10.png
utf8_locale_windows10.png (8.24 KiB) Viewed 794 times
unicode_names.png
unicode_names.png (31.92 KiB) Viewed 794 times

This is still not perfect. For example if I do Ctrl+C and then Ctrl+V on some of non-English named file its name is not properly taken. Seems like a wrong string length calculation (most likely truncates bytes according to amount of UTF-8 chars where the first six chars encoded by 12 bytes)
unicode_names_ctrlc_ctrlv.png
unicode_names_ctrlc_ctrlv.png (19.37 KiB) Viewed 794 times
But this is much better than nothing and could be a starting point to add a full Unicode support into Altap Salamander. Also, according to the Wikipedia quote above enabling UTF-8 locale globally isn't necessary and an application, in our case the Altap Salamander itself, could enable the UTF-8 locale for itself programmatically.

What do you think?

I know, Altap don't want to make Salamander's code open source. That's very strange decision but maybe with this support of UTF-8 locale in Windows 10 they could fix it by themselves? I think it should be much easier than the original plan of adding a Unicode support into Salamander without UTF-8 locale.
yegon
Posts: 1
Joined: 26 Oct 2020, 22:51

Re: UTF-8 locale brings unicode support into Altap Slamander

Post by yegon »

Whoa, this changes everything :) Thanks for the heads up.

I did some quick testing using the internal Altap copy/move functions (F5/F6) and everything just worked. Czech, Russian, Hebrew, Polish. Copying, moving and launching in UTF-8 aware external app. Very, very nice.
Post Reply