<div dir="ltr"><div>Hi Moritz,</div><div><br></div><div>What will happen if outputting the result to a file and open it with a text editor?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 13, 2019 at 5:59 AM Moritz Angermann <<a href="mailto:moritz.angermann@gmail.com" target="_blank">moritz.angermann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I've been trying to figure out why we have some issues with wine executing<br>
our cross compiled haskell programs when unicode is involved.  I've been able<br>
to distill this to the attached C program. Compiled with gcc-7.4.0 like<br>
<br>
  x86_64-pc-mingw32-gcc  main.c -o main-c.exe -finput-charset=UTF-8<br>
<br>
this yields an executable[1] that when invoked via wine will produce:<br>
<br>
```<br>
CP_UTF8 = 65001<br>
foo foo2 Hi there!<br>
```<br>
<br>
when run on windows 10 in a cmd shell<br>
<br>
```<br>
CP_UTF8 = 65001<br>
foo 👋 bar<br>
<br>
foo2 👋 bar<br>
Hi there!<br>
```<br>
<br>
I've tried this with wine3 and wine4, but keep getting the same<br>
results. It appears as if wine is somehow choking on the encoded<br>
bytes.<br>
<br>
Any hints as to what might be wrong?<br>
<br>
Cheers,<br>
 Moritz<br>
<br>
---<br>
[1]: <a href="https://www.dropbox.com/s/bc2fhtuv1u25i1w/main-c.exe?dl=0" rel="noreferrer" target="_blank">https://www.dropbox.com/s/bc2fhtuv1u25i1w/main-c.exe?dl=0</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div></div>