2
Hello, I have an XML that returns from a webservice with encoding errors, on encoding XML is like UTF-8 but it doesn’t display accents correctly and I can’t detect which correct encoding it should be. I have no information as to how it is stored in the original database or any other of the type, I just get back the same. here an example of how I receive XML:
<?xml version="1.0" encoding="UTF-8"?>
<test>
<title>Muitos cientistas intrØpidos se aventura no coraĿªo dos dois vulcıes mais explosivos do planeta</title>
</test>
How can I convert/detect encoding and fix accent errors? Is there any way to convert this characters after generator by the webservice or this correction can only be done in the webservice itself once the XML has already been generated?
Note: I have tried functions like iconv
, utf8_decode
, mb_convert_encode
.
Thanks in advance.
tried a solution using
iconv()
? Here is an example: http://stackoverflow.com/a/7980354/1001109– Ricardo Moraleida
Yeah, buddy just read the description of the question.
– rafaelphp
It would be interesting to AP, that the negatives were explained, so he can improve the question...
– MagicHat
@rafaelphp put the code that takes this XML...
– MagicHat
Correct in this case is correct in XML at source
– jlHertel
do not have access to Ws. as said in the question.
– rafaelphp
Is it not mixing something from xml or some other script and at the time of output it is conflicting? Are you sure it is in WS? Could put the working code?
– Guilherme Nascimento
already tried several ways, Curl, file_get_contents etc to memso when accessing the url the browser comes with the same xml
– rafaelphp
Have you tried utf8-Ncode ?!? Did you check the file Find? *(not likely) Already gave mb_detect_encoding() to find the encoding that is coming ?
– Bartolomeu S. Gusella
Just to understand you are using an external service that returns the broken string in the right xml ?
– Bartolomeu S. Gusella
Ideally you provide the endpoint of this xml for us to look at.
– navossoc