The Unix wrapper fails to decode multibyte command line arguments, resulting in either a segmentation fault (3.5.25) or the multibyte arguments being interpreted as empty strings (3.5.20) resulting in a fatal error.
To reproduce (in an environment with multibyte locale, e.g. LC_ALL=en_US.UTF-8):
1. Build the wrapper (I tried the 64bit edition)
2. bin/wrapper télécharge.conf
(the file does not have to exist, since it is never read)
As far as I can tell, this is caused by not having set the locale to anything other than "C" (the default). mbstowcs, used in int main(…) in wrapper_unix.c (line 1762 and 1778 in the 3.5.25 sources) to convert multibyte arguments to wide char strings, depends on the locale being set according to the environment.
The locale is currently only set according to the environment right after the command line argument have been decoded (line 1783 and the surrounding code). This should be the very first thing to do in main(…) instead. If I move this code to the start of main(…), multibyte command line arguments seem to be accepted just fine.
Note: I have not tested the wrappers for other platforms. This bug report resulted from a bug report on the Freenet bug tracker [1], where one of our users on Ubuntu 14.04 could not run the wrapper when "Téléchargement" (French for Download) was in his path.
Bert,
Thank you very much for letting us know about this bug.
We could reproduce it on our machines.
We will look at it and fix it for the next version of the Wrapper.
Regards
I see "Fix bug when converting from multibyte to wide char without setting the locale at startup (Unix only). Thanks to Bert." in the 3.5.26 release notes. Was this fixed?