<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Robert, hi all,<br>
      <br>
      I think I understand now. I use unicode for strings. I convert the
      names with the streaming operator to a WSTRINGSTREAM object. So I
      think this conversion treats the UTF8-Strings as ANSI-Strings. If
      I would do the conversion with "MultiByteToWideChar" using
      CP_UTF8, the conversion would be perfect. <br>
      <br>
      So both host API's that I have fixed was not broken. The WASAPI
      API instead is broken, because it does convert to ANSI instead of
      UTF8. It works perfectly in my case, just because I do the
      matching convertion ANSI -&gt; Unicode. <br>
      <br>
      Please correct me if I've missed a point.<br>
      <br>
      Best Regards,<br>
      <br>
      Volker<br>
      <br>
      Am 13.12.2016 um 07:46 schrieb Robert Bielik:<br>
    </div>
    <blockquote
      cite="mid:90dbf210ca7c4756a7f08fe8f55db83e@hosted3-mb01.itm.host"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US">Hi
              Volker, Phil,<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"
              lang="EN-US">There was a design choice “back then” that
              all strings be represented as UTF8 in the PA API. UTF8 is
              perfectly capable of representing all international
              characters, it is only a character encoding. So if there
              are problems it is probably a bug in the conversion code.<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"
              lang="EN-US"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"
              lang="EN-US">Regards<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"
              lang="EN-US">/Robert<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;mso-fareast-language:EN-US"
              lang="EN-US"><o:p> </o:p></span></font></p>
        <div style="border:none;border-left:solid blue 1.5pt;padding:0cm
          0cm 0cm 4.0pt">
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0cm 0cm 0cm">
              <p class="MsoNormal"><b><font face="Calibri" size="2"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;font-weight:bold"
                      lang="EN-US">From:</span></font></b><font
                  face="Calibri" size="2"><span
                    style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"
                    lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:portaudio-bounces@lists.columbia.edu">portaudio-bounces@lists.columbia.edu</a>
                    [<a class="moz-txt-link-freetext" href="mailto:portaudio-bounces@lists.columbia.edu">mailto:portaudio-bounces@lists.columbia.edu</a>]
                    <b><span style="font-weight:bold">On Behalf Of </span></b>Phil
                    Burk<br>
                    <b><span style="font-weight:bold">Sent:</span></b>
                    den 12 december 2016 18:24<br>
                    <b><span style="font-weight:bold">To:</span></b>
                    portaudio list <a class="moz-txt-link-rfc2396E" href="mailto:portaudio@lists.columbia.edu">&lt;portaudio@lists.columbia.edu&gt;</a><br>
                    <b><span style="font-weight:bold">Subject:</span></b>
                    Re: [Portaudio] Unicode conversion issues
                    WDMKS/WASAPI: Fix and Question<o:p></o:p></span></font></p>
            </div>
          </div>
          <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                style="font-size:12.0pt"><o:p> </o:p></span></font></p>
          <div>
            <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                  style="font-size:12.0pt">Hello Volker,<o:p></o:p></span></font></p>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt">Thanks for finding this
                    problem and fixing it.<o:p></o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt">&gt; </span></font><font
                  size="2"><span style="font-size:9.5pt">how can I send
                    the changes to the PortAudio maintainers?</span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="2"><span
                    style="font-size:9.5pt">Good question. This is easy
                    on GitHub. People can fork the main repo and then we
                    pull from their fork. I have sent an email to
                    Assembla support asking how we do the equivalent on
                    Assembla. If necessary, we could take a patch from
                    git diff, apply it locally and then push it from our
                    account.</span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="2"><span
                    style="font-size:9.5pt">&gt;  what is the reason for
                    using  CP_UTF8 if UNICODE is defined?  </span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="2"><span
                    style="font-size:9.5pt">For text that is mostly
                    ASCII with a few special characters, UTF8 is smaller
                    than unicode.</span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <div>
                <p class="MsoNormal"><font face="Times New Roman"
                    size="2"><span style="font-size:9.5pt">&gt; From my
                      understanding it would garble foreign special
                      characters </span></font><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"><font face="Times New Roman"
                    size="2"><span style="font-size:9.5pt">&gt; anyway,
                      if it is build with unicode charset or not.</span></font><o:p></o:p></p>
              </div>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="2"><span
                    style="font-size:9.5pt">I do not understand the
                    question. UTF8 is able to represent international
                    characters.  Are you pointing out a bug in the code?</span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="2"><span
                    style="font-size:9.5pt">Phil Burk</span></font><o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            </div>
          </div>
          <div>
            <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                  style="font-size:12.0pt"><o:p> </o:p></span></font></p>
            <div>
              <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                    style="font-size:12.0pt">On Thu, Dec 1, 2016 at 7:34
                    AM, Volker Bijewitz &lt;<a moz-do-not-send="true"
                      href="mailto:volker@bijewitz.de" target="_blank">volker@bijewitz.de</a>&gt;
                    wrote:<o:p></o:p></span></font></p>
              <blockquote style="border:none;border-left:solid #CCCCCC
                1.0pt;padding:0cm 0cm 0cm
                6.0pt;margin-left:4.8pt;margin-right:0cm">
                <p class="MsoNormal" style="margin-bottom:12.0pt"><font
                    face="Times New Roman" size="3"><span
                      style="font-size:12.0pt">Hi,<br>
                      <br>
                      I use PortAudio under windows. I found that device
                      names under WASAPI and WDMKS are garbled. Problem:
                      WideCharToMultiByte with the parameter CP_UTF8
                      does not convert special characters (german
                      umlauts) properly. I found the essential parts in
                      pa_win_wdmks.c line 3600 and pa_win_wasapi.c line
                      1638. The problem is the same like described in
                      ticket #224.<br>
                      <br>
                      I have fixed this like it is done in pa_win_ds.c.
                      I've setup a GIT project and a free Assembla
                      account. I've created a new branch and committed
                      the changes into the local repository. But I can
                      not push it to Assembla. So, how can I send the
                      changes to the PortAudio maintainers?<br>
                      <br>
                      A question: in pa_win_ds.c I see that the usage of
                      the codepage CP_UTF8 or CP_ACP depends on the
                      define UNICODE. If UNICODE is not defined, CP_ACP
                      is used, that behaves properly. Here it is:<br>
                      <br>
                      #if !defined(_UNICODE) &amp;&amp;
                      !defined(UNICODE)<br>
                              size_t len = WideCharToMultiByte(CP_ACP,
                      0, src, -1, NULL, 0, NULL, NULL);<br>
                      <br>
                              result =
                      (char*)PaUtil_GroupAllocateMemory( allocations,
                      (long)(len + 1) );<br>
                              if( result ) {<br>
                                  if (WideCharToMultiByte(CP_ACP, 0,
                      src, -1, result, (int)len, NULL, NULL) == 0) {<br>
                                      result = 0;<br>
                                  }<br>
                              }<br>
                      #else<br>
                              size_t len = WideCharToMultiByte(CP_UTF8,
                      0, src, -1, NULL, 0, NULL, NULL);<br>
                      <br>
                              result =
                      (char*)PaUtil_GroupAllocateMemory( allocations,
                      (long)(len + 1) );<br>
                              if( result ) {<br>
                                  if (WideCharToMultiByte(CP_UTF8, 0,
                      src, -1, result, (int)len, NULL, NULL) == 0) {<br>
                                      result = 0;<br>
                                  }<br>
                              }<br>
                      #endif<br>
                      <br>
                      My question: what is the reason for using  CP_UTF8
                      if UNICODE is defined? From my understanding it
                      would garble foreign special characters anyway, if
                      it is build with unicode charset or not. What do I
                      miss at this point? Anyway, I hold on this pattern
                      for my build, I've not set UNICODE so it works for
                      me perfectly.<br>
                      <br>
                      Thank you,<br>
                      <br>
                      Volker Bijewitz<br>
                      <br>
                      <br>
                      <br>
                      _______________________________________________<br>
                      Portaudio mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:Portaudio@lists.columbia.edu"
                        target="_blank">Portaudio@lists.columbia.edu</a><br>
                      <a moz-do-not-send="true"
                        href="https://lists.columbia.edu/mailman/listinfo/portaudio"
                        target="_blank">https://lists.columbia.edu/mailman/listinfo/portaudio</a><o:p></o:p></span></font></p>
              </blockquote>
            </div>
            <p class="MsoNormal"><font face="Times New Roman" size="3"><span
                  style="font-size:12.0pt"><o:p> </o:p></span></font></p>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Portaudio mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Portaudio@lists.columbia.edu">Portaudio@lists.columbia.edu</a>
<a class="moz-txt-link-freetext" href="https://lists.columbia.edu/mailman/listinfo/portaudio">https://lists.columbia.edu/mailman/listinfo/portaudio</a></pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>