从SQL发送到手机乌尔都语的消息,是在无法读取的格式 [英] Urdu message sent from sql to mobile handset, is in unreadable format

查看:333
本文介绍了从SQL发送到手机乌尔都语的消息,是在无法读取的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分配乌尔都语文本在C#中的变量并将其插入到数据库中(SendMessages表),这样可以节省乌尔都语消息完全没有任何修饰,伟大的,但在没有接到为所有的手机的消息,然后将其显示为 ?????????????????????? ,为什么呢?我检查与完美,但没有收到其他乌尔都语信息这一块全部乌尔都语兼容的手机。

I am assigning Urdu text to a variable in c# and inserting it into database (SendMessages table), it saves Urdu message perfectly without any modification, great but when that message is received in any mobile handset then it appears as ??????????????????????, why ? i checked it with all urdu compatible handsets which receive other urdu messages perfectly but not this one.

code asp.net:

Code asp.net:

String MessageLanguage= Convert.ToString(ViewState["LanguageCode"]); //

                        if (MessageLanguage == "ur")
                        {
                            String UrduMsg = ComplaintCode +" "+"اپکی سثیکایت درج کردی گیؑ ھے۔ سثیکایت کوڈ یہ ہے";
                            quebiz.Insert(lblContact.Text, UrduMsg, null, Convert.ToInt32(lblComplainantID.Text), null, null);
                            ViewState["LanguageCode"] = null;

                        }

在简单的话,被从C#传递到SQL表乌尔都语消息是罚款和完善,而不是问题,但接受相同的短信在手机后,它并没有这样的。

In simple words, urdu message being passed from C# into sql table is fine and perfect, not problem but after receiving same sms in handset, it doesn't work that way.

为什么?帮帮我 ? 我使用asp.net C#.NET 4.0与SQL Server 2014年。

why ? help ? I am using asp.net C#.net 4.0 with sql server 2014.

推荐答案

一个想法可能是在数据库中使用 VARCHAR ,然后按照步骤

An idea could be use varchar in your database and follow the steps

  1. 使用基地64将数据保存到数据库
  2. 使用 Encoding.UTF8 来获得字节,并将其转换为的Base64
  3. 当读取从数据库中使用的数据 Encoding.UTF8.GetString(Convert.FromBase64String(价值),并使用这个值来显示。
  1. Use base 64 to save the data into data base
  2. Use Encoding.UTF8 to get bytes and convert them to Base64
  3. When fetch data from database use Encoding.UTF8.GetString(Convert.FromBase64String("value") and use this value to display.

这篇关于从SQL发送到手机乌尔都语的消息,是在无法读取的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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