INTERACT FORUM

Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: jmone on July 31, 2016, 07:31:48 am

Title: MCWS - Char Encoding Q
Post by: jmone on July 31, 2016, 07:31:48 am
Q - regarding a MCWS call to get extended ASCII characters. 

For example a MC field may contain "Frédéric Chopin, Antonín Dvořák"

If I use File--> Library--> Export to XML, I get a file titled
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

and within it

<Field Name="Description">Frédéric Chopin, Antonín Dvořák</Field>

Looks good......

However, If I call MCWS using:

  WinHTTP := ComObjCreate("WinHTTP.WinHttpRequest.5.1")
  ComObjError(false)
  WinHTTP.Open("GET", http://localhost:52199/MCWS/v1/Files/Search?Action=mpl&ActiveFile=-1&Zone=-1&ZoneType=ID)
  WinHTTP.SetCredentials(MC_UserName,MC_Password,0)
  WinHTTP.SetRequestHeader("Content-type", "application/x-www-form-urlencoded")
  Body = ""
  WinHTTP.Send(Body)
  Result := WinHTTP.ResponseText
  Status := WinHTTP.Status


I get a file with a header saying
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

and within it

<Field Name="Description">Frédéric Chopin, Antonín DvoÅ?ák</Field>

Am I malforming my Request Header?

Thanks
Nathan
Title: Re: MCWS - Char Encoding Q
Post by: Hendrik on July 31, 2016, 09:29:33 am
I get a file with a header saying
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

and within it

<Field Name="Description">Frédéric Chopin, Antonín DvoÅ?ák</Field>

Am I malforming my Request Header?


This looks like UTF-8 encoded strings, you are probably just interpreting it wrong.
Title: Re: MCWS - Char Encoding Q
Post by: jmone on August 14, 2016, 05:45:55 pm
Thanks - got it sorted