商城名称: B2C测试
定单号: WD-2008-1029393
定单金额: RMB 0.02
商品编号: abcd001
商品名称: 灏忔甯
商品数量: 1
-----------------------
在说明文档里面有:
1、数据中不能包含“|”“&”“=”,此字符为银行端程序保留字符;中文变量使用GBK编码,另请注意与C2C接口定义字段名称和大小写有区分那我的
<input name="goodsName" type="text" value='<%= ProductName %>'>
这个ProductName 要怎么转换谢谢
定单号: WD-2008-1029393
定单金额: RMB 0.02
商品编号: abcd001
商品名称: 灏忔甯
商品数量: 1
-----------------------
在说明文档里面有:
1、数据中不能包含“|”“&”“=”,此字符为银行端程序保留字符;中文变量使用GBK编码,另请注意与C2C接口定义字段名称和大小写有区分那我的
<input name="goodsName" type="text" value='<%= ProductName %>'>
这个ProductName 要怎么转换谢谢
解决方案 »
- ASP.NET最流行的,最实用的框架是那些
- 由于cookie中的session
- 100分, 求各种dropdown下拉效果,要求能支持firefox
- 如何让asp.net程序使用代理访问外部网页?
- 静态页当中动态的地方使用AJAX动态调回数据
- 自动生成菜单,出现这样的图标。 为什么
- 怎样在后台设置页面背景图片,或设置css ????????
- 急寻aps.net2005和SQLserver2005教材
- 如何才能不让页面每次都读数据库?
- System.InvalidCastException: 对象不能从 DBNull 转换为其他类型
- ASPNETPAGER 控件绑定对象问题
- asp.net棘手问题,做的我头都疼,那位高手帮帮我啊
string unicodeString = "小毡帽"; // Create two different encodings.
Encoding ascii = Encoding.GetEncoding(936);
Encoding unicode = Encoding.Unicode; // Convert the string into a byte[].
byte[] unicodeBytes = unicode.GetBytes(unicodeString); // Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes); // Convert the new byte[] into a char[] and then into a string.
// This is a slightly different approach to converting to illustrate
// the use of GetCharCount/GetChars.
char[] asciiChars = new char[ascii.GetCharCount(asciiBytes, 0, asciiBytes.Length)];
ascii.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0);
ProductName = new string(asciiChars);我用上面的这样转没有效果啊
谢谢
转:这个原因是提交给支付宝的时候编码格式不统一,目前支付宝支持GBK和utf-8编码.默认传递的是gbk编码,如果是utf-8格式的,必须_input_charset用这个参数指定为utf-8编码._input_charset= ‘utf-8’