在WSDL NuSoap中获取UTF-8字符 [英] get UTF-8 char in WSDL NuSoap

查看:121
本文介绍了在WSDL NuSoap中获取UTF-8字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我在php中使用Nusoap lib进行工作,并向C#WSDL技术发送要求.
现在我需要将php文件或数据库的char UTF-8发送到C#.
我可以发送其他编码,但不能发送UTF-8

在php coe中进行示例:سلام
但是在C#中:سÙ??اÙ

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# : سلاÙ

推荐答案

哈!棘手的部分是:没有"UTF-8字符"之类的东西.仅在UTF-32中,字符和代码字之间是一一对应的.您首先需要了解Unicode和UTF的概念.

Unicode标准只是整数值(称为代码点")之间的对应关系,被认为是抽象的数学整数,而与它们的计算机表示形式,大小,字节序等无关,并且与大多数文化的字符(从字形中抽象出来的文化实体)无关字体和其他详细信息.字符的计算机演示是放在UTF上的一个独立方面. UTF以字节数组形式处理数据.在面向字节的UTF-8中,不同的字符具有不同的大小,在UTF-16中,某些字符占用16位(甚至是ASCII),而某些字符占用32位,即一对称为""的16位单词.代理对".

请参阅以消除混乱:
http://unicode.org/ [ ^ ],
http://unicode.org/faq/utf_bom.html [如何在C#中将ascii转换为unicode [
—SA
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


所有
我解决了这个问题!!!
在nusoap.php文件中搜索
Hi ALL
I SOLVED this problem !!!

in nusoap.php file search for
var


soap_defencoding = ''ISO-8859-1'';
soap_defencoding = ''ISO-8859-1'';

和chenge到var

and chenge to var


这篇关于在WSDL NuSoap中获取UTF-8字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆