Solved

Arabic not showing when i use Htmlencode

Posted on 2004-10-10
12
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 12274316
0
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
If-Then-Else ASP problem 6 78
Downside of adding characters set in ASP pages 6 40
innerHTML 7 45
Html value of radio 14 53
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 informatio…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 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