在asp.net gridview中编辑后,不显示阿拉伯语字体 [英] arabic font is not displaying after editing in asp.net gridview

查看:59
本文介绍了在asp.net gridview中编辑后,不显示阿拉伯语字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我正在使用Asp.net Gridview C#



在我的网页上让Gridview编辑和删除记录。



编辑后显示的记录显示????????????阿拉伯语专栏。



请帮帮我。



谢谢。

Dear All,

am working on Asp.net Gridview C#

on my webpage i have Gridview to edit and delete the records.

after editing the record it shows ???????????? for arabic column.

Please can you help me.

Thanks.

推荐答案

当您尝试将Unicode数据转换为非Unicode编码的某些内容时,这是一种常见的行为。您需要确保从不使用UTF以外的编码。由于您没有提供更多信息来为您提供更详细的建议,这就是全部。



-SA
This is a usual behavior when you try to convert Unicode data into something in non-Unicode encoding. You need to make sure that encodings other then UTFs are never used. As you did not provide more information to give you more detailed advice, that's all.

—SA


您应该使用NVARCHAR来存储阿拉伯数据而不是VARCHAR
You should use NVARCHAR for storing Arabic data instead of VARCHAR


您必须确保网页的内容编码是UTF,否则它将不起作用。以下是一些提示:

1.确保数据库表中数据的数据类型为nvarchar。

2.确保您使用的SP也具有nvarchar作为参数类型。

3.将请求和响应编码设置为UTF-8。在web.config中添加此应用程序级别编码:



You have to make sure that the content encoding for your web pages is UTF, otherwise it is not going to work. Here are few tips:
1. Make sure the datatype of your data in database table is nvarchar.
2. Make sure that the SP you are using also has nvarchar as parameter type.
3. Make request and response encoding as UTF-8. Add this in the web.config for application level encoding:

<configuration>
  <system.web>
    <globalization

      requestEncoding="utf-8"

      responseEncoding="utf-8"      

    />
  </system.web>
</configuration>



并为页面级编码添加此内容:


and add this for page level encoding:

<%@ Page RequestEncoding="utf-8" ResponseEncoding="utf-8" %>



正如SA说我们不知道你搞砸了什么,这可能只是一些可行的建议。如果有帮助,请尝试回来。


And as SA said we don't know what did you screw, this probably is just few suggestions that might work. Try and come back if it helps.


这篇关于在asp.net gridview中编辑后,不显示阿拉伯语字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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