Solved

Arabic not showing when i use Htmlencode

Posted on 2004-10-10
12
263 Views
Last Modified: 2008-01-09
my Arabic charecters are not showing when i use server.Htmlencode(sString)..
It shows as only Numeric codes...
Wt is the solution?
0
Comment
Question by:x1877
  • 6
  • 3
12 Comments
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274290
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274299
0
 

Author Comment

by:x1877
ID: 12274304
sorry forgot to specify... i am using asp not .net
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274316
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274320
after u read above link open this......

http://www.vbcity.com/forums/topic.asp?tid=3674

itsvtk
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274332
Here u go...

you need to use below line at the top of your all asp pages....  for htmlencode operation....

<%
Session.pagecode = 708   ' for Arabic (ASMO 708)
%>

itsvtk

0
 

Author Comment

by:x1877
ID: 12274450
u mean session.CodePage  = 708   ?
0
 
LVL 14

Accepted Solution

by:
Thandava Vallepalli earned 500 total points
ID: 12274477
Hi,

When you use Server.HTMLEncode in the  ASP page that contains Unicode or double-byte character set (DBCS) data (in your case arabic), you may find that the data gets corrupted.

Becuase Server.HTMLEncode method does not recognize Unicode and DBCS data formats and converts the data as if it were in single-byte character set (SBCS) format.

Steps to reproduce...

1. Create an ASP page, and paste the following code into the page:
=====================
<%@ Language=VBScript codepage=950%>
<!--
This example uses a Arabic (ISO)
-->
<%
Session.CodePage = 28596
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-6">
</HEAD>
<BODY>
<FORM action="" method=post id=FORM1 name=FORM1>
<INPUT id=txtValue name=txtValue>
<INPUT id=submit1 name=submit1 type=submit value=Submit>
</FORM>
<HR>
<%
Response.Write(Server.HTMLEncode(Request.Form("txtValue")))
%>
</BODY>
</HTML>
=====================

2. View the ASP page in a Web browser.
3. Enter a Arabic characters into the HTML textbox, and then click Submit.



Plz tell me wheter its working or not ......




If you arabic charset is different than the above plz see this link.....
http://msdn.microsoft.com/library/default.asp?url=/workshop/Author/dhtml/reference/charsets/charset4.asp


You need to modify the code in 2 places according to your charset......

1st place:
<%
  Session.CodePage = <Code Page Number>
%>

2nd Place:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=<Preferred Charset Label>">


itsvtk





Plz read this link
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q259352
0
 

Author Comment

by:x1877
ID: 12274553
thanks for the help  itsvtk,    i will get back to you as soon as i chk all the things u send....
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now