Android c2dm 如何使用土耳其语(所有语言)字符?
我正在开发一个 c2dm 服务器端应用程序和我的代码如下;
string postData = GetPostStringFrom(postFieldNameValue);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
request.ContentLength = byteArray.Length;
request.Headers.Add(HttpRequestHeader.Authorization, "GoogleLogin auth=" + authTokenString);
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
和我处理它的 Android 端代码;
String message = intent.getExtras().getString( "message" );
我成功处理了这个问题,但缺少文本。
例如:
我发送“türkçe öçşğıü”,但我只能处理“trke”
有什么建议吗?
i am developing a c2dm server side application and my code like this;
string postData = GetPostStringFrom(postFieldNameValue);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
request.ContentLength = byteArray.Length;
request.Headers.Add(HttpRequestHeader.Authorization, "GoogleLogin auth=" + authTokenString);
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
and my android side code which i handle it;
String message = intent.getExtras().getString( "message" );
i handle this successfully but text was missing.
for example:
i send "türkçe öçşğıü" but i can handle only "trke"
any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将 char 类型作为 unicode 发送
.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
try sending char type as unicode in
.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
我解决了这个问题。
我们需要对发送数据进行 uri 编码。当我编码数据时,我可以发送它。
谢谢..
i resolve this problem.
we need to uri encoding for my sending data. when i was encode data, i can sent it.
thanks..