Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# PHP SOAP
Hi All
I work whit Nusoap lib in php and send a requst to C# whit WSDL tech
now I need send a char UTF-8 of php file or database to C# .
I can send other encoding but can't send UTF-8
 
for examlpe in php coe : سلام
but in C# : سلاÙ
Posted 22-Dec-11 8:50am
Edited 22-Dec-11 9:16am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Ha! The tricky part is: there is no such thing as "UTF-8 char". It's only in UTF-32 there is a one-to-one correspondence between characters and code words. You first need to understand the idea of Unicode and UTFs.
 
Unicode standard is just a correspondence between integer values, called "code points" and considered as abstract mathematical integers without concerns to their computer presentation, size, endianess, etc., and characters of most cultures, understood as cultural entities, abstracted from the glyph fonts and other detail. Computer presentations of the characters is a separate aspect put on UTFs. UTFs work with data as an array of bytes. In UTF-8, which is byte-oriented, different characters have different size, in UTF-16 some characters take 16 bits (even ASCII), and some take 32-bits, a pair of 16-bit words called "surrogate pair".
 
Please see to remove confusion:
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].
 
Just in case, see my other answer on the topic: How do i convert from ascii to unicode in C#[^].
 
You don't have to do anything special to pass Unicode text in you Web service, but you should work with Unicode text or characters, not with UTFs. As you work with SOAP, the soup file/stream supports UTF-8. It should be prescribed in its "HTTT-EQUIV".
 
—SA
  Permalink  
v3
Comments
thatraja at 22-Dec-11 14:46pm
   
5!
SAKryukov at 22-Dec-11 14:57pm
   
Thank you, Raja.
--SA
esmailian at 23-Dec-11 6:42am
   
I can't find a solution about this promblem plz help me by a code . how can convert a encoding in other encoding or write a trick code .
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi ALL
I SOLVED this problem !!!
 
in nusoap.php file search for
var $soap_defencoding = 'ISO-8859-1';
and chenge to var
 $soap_defencoding = 'UTF-8';
 
ALL THING OK
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 275
1 Maciej Los 214
2 Sergey Alexandrovich Kryukov 200
3 King Fisher 185
4 OriginalGriff 163
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 23 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100