Page 1 of 1

UTF-8 locale brings unicode support into Altap Slamander

Posted: 17 Oct 2020, 13:10
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 1067 times
unicode_names.png
unicode_names.png (31.92 KiB) Viewed 1067 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 1067 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.

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

Posted: 26 Oct 2020, 22:59
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.

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

Posted: 12 Jan 2021, 11:02
by tukanos
yegon wrote: 26 Oct 2020, 22:59 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.
This is indeed a nice feature. I don't think this changes much, because it needs to be tested and fixed in case of issues. Since there are no developers working on Salamander it does not change much.