<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 290: Unix wrapper crashes on multibyte command line arguments</title><link href="https://sourceforge.net/p/wrapper/bugs/290/" rel="alternate"/><link href="https://sourceforge.net/p/wrapper/bugs/290/feed.atom" rel="self"/><id>https://sourceforge.net/p/wrapper/bugs/290/</id><updated>2015-07-05T04:34:35.036000Z</updated><subtitle>Recent changes to 290: Unix wrapper crashes on multibyte command line arguments</subtitle><entry><title>#290 Unix wrapper crashes on multibyte command line arguments</title><link href="https://sourceforge.net/p/wrapper/bugs/290/?limit=25#c0da" rel="alternate"/><published>2015-07-05T04:34:35.036000Z</published><updated>2015-07-05T04:34:35.036000Z</updated><author><name>WormNut</name><uri>https://sourceforge.net/u/askstevedcom/</uri></author><id>https://sourceforge.netd5e7dc4e0f258532673410a1f7689192a5faa4d9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#290 Unix wrapper crashes on multibyte command line arguments</title><link href="https://sourceforge.net/p/wrapper/bugs/290/?limit=25#474b" rel="alternate"/><published>2014-11-07T02:39:08.426000Z</published><updated>2014-11-07T02:39:08.426000Z</updated><author><name>Alexandre</name><uri>https://sourceforge.net/u/alex-tanuki/</uri></author><id>https://sourceforge.netfd55dac35839476fbc38d7525e88c7458a336c40</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Bert,&lt;/p&gt;
&lt;p&gt;Thank you very much for letting us know about this bug.&lt;br /&gt;
We could reproduce it on our machines.&lt;/p&gt;
&lt;p&gt;We will look at it and fix it for the next version of the Wrapper.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Unix wrapper crashes on multibyte command line arguments</title><link href="https://sourceforge.net/p/wrapper/bugs/290/" rel="alternate"/><published>2014-11-06T15:41:01.473000Z</published><updated>2014-11-06T15:41:01.473000Z</updated><author><name>Bert Massop</name><uri>https://sourceforge.net/u/bert-m/</uri></author><id>https://sourceforge.net54170f5ac50710ad7692ff44ed8a8059dca60d7a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;To reproduce (in an environment with multibyte locale, e.g. &lt;code&gt;LC_ALL=en_US.UTF-8&lt;/code&gt;):&lt;br /&gt;
1. Build the wrapper (I tried the 64bit edition)&lt;br /&gt;
2. bin/wrapper télécharge.conf&lt;br /&gt;
(the file does not have to exist, since it is never read)&lt;/p&gt;
&lt;p&gt;As far as I can tell, this is caused by not having set the locale to anything other than &lt;code&gt;"C"&lt;/code&gt; (the default). &lt;code&gt;mbstowcs&lt;/code&gt;, used in &lt;code&gt;int main(…)&lt;/code&gt; in &lt;code&gt;wrapper_unix.c&lt;/code&gt; (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.&lt;/p&gt;
&lt;p&gt;The locale is currently only set according to the environment &lt;em&gt;right after&lt;/em&gt; the command line argument have been decoded (line 1783 and the surrounding code). This should be the very first thing to do in &lt;code&gt;main(…)&lt;/code&gt; instead. If I move this code to the start of &lt;code&gt;main(…)&lt;/code&gt;, multibyte command line arguments seem to be accepted just fine.&lt;/p&gt;
&lt;p&gt;Note: I have not tested the wrappers for other platforms. This bug report resulted from a bug report on the Freenet bug tracker &lt;span&gt;[1]&lt;/span&gt;, 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.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[1]&lt;/span&gt; &lt;a href="https://bugs.freenetproject.org/view.php?id=6313" rel="nofollow"&gt;https://bugs.freenetproject.org/view.php?id=6313&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>