Solved

Arabic not showing when i use Htmlencode

Posted on 2004-10-10
12
261 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
Comment Utility
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
Comment Utility
0
 

Author Comment

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

Expert Comment

by:Thandava Vallepalli
Comment Utility
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 14

Expert Comment

by:Thandava Vallepalli
Comment Utility
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
Comment Utility
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
Comment Utility
u mean session.CodePage  = 708   ?
0
 
LVL 14

Accepted Solution

by:
Thandava Vallepalli earned 500 total points
Comment Utility
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
Comment Utility
thanks for the help  itsvtk,    i will get back to you as soon as i chk all the things u send....
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

11 Experts available now in Live!

Get 1:1 Help Now