首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > BlackBerry >

黑莓通过blowser push过来的title中文会乱码,该怎么处理

2012-01-16 
黑莓通过blowser push过来的title中文会乱码无论是通过NONPAP方式string httpURL http:// + BESAddres

黑莓通过blowser push过来的title中文会乱码
无论是通过NONPAP方式
  string httpURL = "http://" + BESAddress + ":" + BESWebserverListenPort
  + "/push?DESTINATION=" + pushPin + "&PORT=" + pushPort
  + "&REQUESTURI=/";

还是通过PAP方式


设置它的X-RIM-Push-Title为中文 在手机上收到的消息标题都是乱码 里面的内容是正常的  

改了PAP协议的整个的字符编码为UTF-8都没用 

搜遍了都没找到答案 真的一点思路都没有了 求助啊  
不知道各位是怎么做黑莓推送的 送过来的标题是中文么

[解决办法]

C# code
public string Encode(string str)        {            try            {                byte[] bytes = Encoding.GetEncoding("utf-8").GetBytes(str);                string result = "=?UTF-8?B?" + Convert.ToBase64String(bytes) + "?=";                return result;            }            catch (Exception ex)//(UnsupportedEncodingException ex)            {                return null;            }        } 

热点排行