Search code examples
phpdelphicharacter-encodingdelphi-xe2nusoap

Conversion problems with NuSOAP and Delphi XE2


My team and I have a problem with the codification of the strings that we are using in our delphi software:

The string follows the next process:

Delphi String->SOAPMessage->Internet->NuSoap->SQLServer

The collation of the SQLServer is Modern_Spanish_CI_AS because we are Spaniards. The SOAPMessage has the ISO-8856-1 encoding.

So the fun starts with the "specials characters" as ñ,í,ó,etc...

When we introduce one of these characters in the DB " Ñ " becomes in " Ñ " for instance.

We guess that the problem is in the nuSoap parser and PHP because before the message processing in the server we introduce the raw data in a SQL server table and the characters are readable.

All the posts that I read so far related with codification in NuSoap become from people who want to use the Utf-8. But the problem is that we want to use ISO-8856-1 encoding. Any idea to introduce this special characters?


Solution

  • The patch that we applied it's awful but it's working now, so the http header now has ISO-8856-1 Encoding, and the content of the xml also has ISO-8856-1 encoding, but we needed to modify the xml header to show literally Utf-8. At the end, the message had this format:

    <Http header>
        charset="ISO-8856-1"
    </Http Header>
    
    <content>
    
        <xml encoding ="UTF-8">
            Body encoded using ISO-8856-1 
        </xml>
    </content>
    

    The problem is in the nusoap parser and we are moving to another library. Meanwhile that worked.