Solved

Problem displaying Arabic text from SQL server using ASP & Dreamweaver MX

Posted on 2003-11-16
7
801 Views
Last Modified: 2012-05-04
I am developing a website using ASP and SQL server.
I am using a windows 2000 professional and dreamweaver MX for development.

The problem is that the I am getting ????? (question marks) whenever a section of any page tries to show records from the database having Arabic text.
In the same page links written in arabic show up fine, but the problem is reading from database.

My ASP files are set as follows:
codepage=1256
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1256">

What is the problem and how am i suppose to solve it?
0
Comment
Question by:Samer Kharsa
7 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 250 total points
ID: 9762521
Try adding this to the meta tags..
<%@CODEPAGE=1256%>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" >.

By the way, are you running the site from NT 4.0?. It doesnt have UTF-8 Support ...Read through this article for more details..
http://msdn.microsoft.com/msdnmag/issues/0700/localize/default.aspx

Cheers!!
0
 

Assisted Solution

by:txtphile
txtphile earned 250 total points
ID: 9777312
hi ... i am currently developing a multilanguage cms and one of languages is arabic and i had the same issue as yourself in the development cycle. If you are responsible for the content being posted into the database i would consider posting the arabic to the database as unicode. This has many advantages and i have found it useful for searching, caching and mixing the display with other langauges ...
0
 

Author Comment

by:Samer Kharsa
ID: 9786028
Can you explain how to post using unicode?
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.

 

Expert Comment

by:txtphile
ID: 9786085
good point .. well basically ... and this is the odd thing, my application does it naturally. e.g


&#1588;&#1585;&#1591;&#1577; &#1603;&#1575;&#1604;&#1610;&#1601;&#1608;&#1585;&#1606;&#1610;&#1575; &#1578;&#1589;&#1583;&#1585; &#1575;&#1605;&#1585; &#1575;&#1593;&#1578;&#1602;&#1575;&#1604; &#1604;&#1604;&#1605;&#1594;&#1606;&#1610; &#1575;&#1604;&#1575;&#1605;&#1585;&#1610;&#1603;&#1610; &#1575;&#1604;&#1588;&#1607;&#1610;&#1585;&#1548; &#1608;&#1575;&#1604;&#1605;&#1583;&#1593;&#1610; &#1575;&#1604;&#1593;&#1575;&#1605; &#1604;&#1604;&#1608;&#1604;&#1575;&#1610;&#1577; &#1610;&#1572;&#1603;&#1583; &#1575;&#1606; &#1602;&#1608;&#1575;&#1606;&#1610;&#1606;&#1607;&#1575; &#1602;&#1583; &#1578;&#1594;&#1610;&#1585;&#1578; &#1576;&#1593;&#1583; &#1606;&#1580;&#1575;&#1581; &#1580;&#1575;&#1603;&#1587;&#1608;&#1606; &#1601;&#1610; &#1575;&#1604;&#1575;&#1601;&#1604;&#1575;&#1578; &#1605;&#1606; &#1602;&#1590;&#1610;&#1577; &#1605;&#1605;&#1575;&#1579;&#1604;&#1577;.

Now why is that! i remember that this was not the case when we were using a rapid dev application like mx to test the principles. i would attempt a hand written sql insert into one field from one form element. and see whether it is mx ... failing this i have a js function that converts the string from a field to demical unicode suitable for html viewing. This could be used as a middle tier to convert the string before posting it to your db insert execution. let me see if i can dig it out ...
0
 

Expert Comment

by:txtphile
ID: 9797217
no answer so i am not sure you have tried my previous comment - it would be nice to have some feedback. In the meantime this is an example of converting strings to unicode .. it is i believe the answer to how to store your arabic text.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
response.Write(request.form("unicode"))
response.Write("<br/><br/>")
response.Write(request.form("text"))
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<script>

function convertToUnicodeDecFull(source)
{
    result = '';
    for (i=0; i<source.length; i++)
        result += '&#' + source.charCodeAt(i) + ';';
    return result;
}

function convert()
{
form.unicode.value = convertToUnicodeDecFull(form.text.value);
}
</script>
<form action="" method="post" name="form" id="form">
  <textarea name="text" rows="10" id="text"></textarea>
  <input type="submit" name="Submit" onclick="convert()" value="Submit">
  <input name="unicode" type="hidden" id="unicode">
</form>
</body>
</html>
0
 
LVL 7

Expert Comment

by:vnvk
ID: 12474850
This Question is now classified abandoned as no comment has been added to this question in more than 21 days.

I will leave the following recommendation on this question to the moderators in the Cleanup topic area:
    Split: ap_sajith {http:#9762521} & txtphile {http:#9777312}

Any objections should be posted here in the next 4 days. After that time, the question will be closed at the discretion of the moderator.

vnvk
EE Cleanup Volunteer
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

Suggested Solutions

Title # Comments Views Activity
pass url parameter as session 9 48
An ASP query I cannot work out... 2 46
Update table value with join syntax 2 60
Time/Date Query 11 37
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 …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

12 Experts available now in Live!

Get 1:1 Help Now