<div dir="ltr">Never mind. After spending alot of time, I got it working....<div>Working code:</div><div><div><span style="white-space:pre"> </span> $8Bytes = [System.Text.Encoding]::UTF8.GetBytes( $request.innerXml )</div></div><div><div><span style="white-space:pre"> </span> $response = Invoke-RestMethod -Method Post -Body $8Bytes -Uri $server -ErrorAction Stop -ContentType "text/plain; charset=utf8"</div></div><div><br></div><div><br></div><div>Not sure why but the encoding above makes it work as it's suppose to do. Now it takes scandinavian chars without any problems :D</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 June 2018 at 23:26, Thor <span dir="ltr"><<a href="mailto:thor918@gmail.com" target="_blank">thor918@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have been using powershell againt zimbra for a long time. but now I was about to experiment on some code to do search queries, I'm hitting a wall. I think perhaps the problem lies in powershell.<div>so far I havent managed to get around this yet. </div><div><br></div><div>I'm using "Invoke-RestMethod -Method Post" to submitt my zimbra soap request.</div><div>everything works if my search is standard english chars. However once I add my scandinavian chars. it just dosent work. </div><div><br></div><div>and I get this in mailbox.log</div><div><br></div><div><div>misc - Problem parsing XML - Fatal Error: Problem on line 1 of document : Invalid byte 1 of 1-byte UTF-8 sequence.</div></div><div><div>soap - C: (ParseError:Document parse failed)</div></div><div><div><soap:Body><SearchRequest xmlns="urn:zimbraMail" fullConversation="0" limit="100" query="m�terom " types="message" fetch="all" html="1" max="10"><header n="X-Spam-Status" /><header n="X-Spam-Flag" /></SearchRequest></soap:Body></div></div><div><br></div><div><br></div><div>is suppose to say query="møterom". (i'm looking at mailbox.log using a ssh client set to show utf-8)</div><div><br></div><div>Anyone hit the same problem and have a workaround ?</div></div>
</blockquote></div><br></div>