5
I have a Windows Forms application that is consuming a Webservice that returns an xml (string) enconding with ISO-8859-1.
However, the answer comes with question characters (?) instead of accents.
How to convert or read to ISO-8859-1, so that the accent comes correctly?
Code:
string empresa = "loginEmpresa";
string token = "tZTMMnOO+oZZmlwhSRuFbQ==";
string xmlPublicacoes = "";
br.com.dominio.portal.IIFServiceservice webService = new br.com.dominio.portal.IIFServiceservice();
xmlPublicacoes = webService.ObterPublicacoesPorGrupo(empresa, token, 3997, "01/12/2015");
MessageBox.Show(xmlPublicacoes); //Aqui o texto com erro de encoding
XML Retorno:
Is the client you are using from the web service WCF? As the class
IIFServiceservice
was created (i.e., by hand, using "Add Service Reference", etc.)?– carlosfigueira
Using "Add Service Reference". @carlosfiguer
– Léo B
Have you ever tried using UTF-8 ? I have no problems using this encoding.
– JcSaint
@Jcsaint cannot change the return of Webservice. It already returns in ISO-8859-1.
– Léo B
take a look at this post http://stackoverflow.com/a/8778384/2588695
– JcSaint