PHP SOAP server doesn't correctly process UTF-8 strings from a C# SOAP client

Subseven

New Member
I have a PHP SOAP server (using nuSOAP) that I consume with a C#-based application.When the C# application submits a request, the strings are UTF-8 encoded. I verified using a network sniffer that the byte sequences are valid UTF-8. However, when PHP gets then and I post them to the database or send them by email, it appears to be printed like standard ASCII, the UTF encoding bytes are treated as characters.I have the same issue with the C# app receiving UTF-8 from the SOAP server. .NET interprets each byte as a CHAR instead of a BYTE. I had to write a small function that converts each CHAR to a BYTE and then converts that to a UTF-8 string and that's working perfectly.The question is, what do I need to do on the PHP server side to correctly process the incoming SOAP requests as UTF-8 for MySQL and the \[code\]mail()\[/code\] function? I've tried \[code\]utf8_encode()\[/code\] and \[code\]utf8_decode()\[/code\] but those mangle the string even worse.
 
Back
Top