<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 290: Unix wrapper crashes on multibyte command line arguments</title><link>https://sourceforge.net/p/wrapper/bugs/290/</link><description>Recent changes to 290: Unix wrapper crashes on multibyte command line arguments</description><atom:link href="https://sourceforge.net/p/wrapper/bugs/290/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sun, 05 Jul 2015 04:34:35 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/wrapper/bugs/290/feed.rss" rel="self" type="application/rss+xml"/><item><title>#290 Unix wrapper crashes on multibyte command line arguments</title><link>https://sourceforge.net/p/wrapper/bugs/290/?limit=25#c0da</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WormNut</dc:creator><pubDate>Sun, 05 Jul 2015 04:34:35 -0000</pubDate><guid>https://sourceforge.netd5e7dc4e0f258532673410a1f7689192a5faa4d9</guid></item><item><title>#290 Unix wrapper crashes on multibyte command line arguments</title><link>https://sourceforge.net/p/wrapper/bugs/290/?limit=25#474b</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexandre</dc:creator><pubDate>Fri, 07 Nov 2014 02:39:08 -0000</pubDate><guid>https://sourceforge.netfd55dac35839476fbc38d7525e88c7458a336c40</guid></item><item><title>Unix wrapper crashes on multibyte command line arguments</title><link>https://sourceforge.net/p/wrapper/bugs/290/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bert Massop</dc:creator><pubDate>Thu, 06 Nov 2014 15:41:01 -0000</pubDate><guid>https://sourceforge.net54170f5ac50710ad7692ff44ed8a8059dca60d7a</guid></item></channel></rss>