Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Arabic not showing when i use Htmlencode

Posted on 2004-10-10
12
Medium Priority
?
279 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
 

Author Comment

by:x1877
ID: 12274304
sorry forgot to specify... i am using asp not .net
0
Independent Software Vendors: 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

604 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