From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8897 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl and legacy win32 apps through wine Date: Wed, 18 Nov 2015 11:24:18 -0500 Message-ID: <20151118162418.GN3818@brightrain.aerifal.cx> References: <20151117132115.02be8539@r2lynx> <20151117210248.GC3818@brightrain.aerifal.cx> <20151118094558.1cc82bee@r2lynx> <20151118133244.3ff957eb@r2lynx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1447863893 4627 80.91.229.3 (18 Nov 2015 16:24:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2015 16:24:53 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8910-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 18 17:24:53 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zz5X8-0002n5-KT for gllmg-musl@m.gmane.org; Wed, 18 Nov 2015 17:24:34 +0100 Original-Received: (qmail 21611 invoked by uid 550); 18 Nov 2015 16:24:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21593 invoked from network); 18 Nov 2015 16:24:31 -0000 Content-Disposition: inline In-Reply-To: <20151118133244.3ff957eb@r2lynx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8897 Archived-At: On Wed, Nov 18, 2015 at 01:32:44PM +0700, Рысь wrote: > I managed to get it work easily - the fact that Wine does all encoding > by it's own powers happily eases the task, and drafts to using the > simple LD_PRELOAD hack: > > % cat libbrklocale.c > #include > #include > > char d[64]; > > char *setlocale(int cat, const char *locale) > { > char *p = d; > > strcpy(d, "ru_RU.UTF-8"); > return p; > } > > % cc -shared -fPIC libbrklocale.c -o libbrklocale.so > % LD_PRELOAD=./libbrklocale.so wine prog1251.exe > > I can hardcore it into Wine itself by calling appropriate setlocale > from somewhere, but it's easier to use it as is since my Wine setup is > going into separate chroot directory. > > The problem was discovered with Wine debugging facility, it got mixed > locale with mixed "C" and "ru_RU.UTF-8" for > LC_ALL/LC_MESSAGES/LC_CTYPE. It used latter for encoding, and text was > garbled. Now everything is consistent and works flawlessly. Are you perhaps using an older version of musl? Recent versions should report the locale you requested for all categories, not a mix of C and your requested locale. Rich