?
Solved

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

Posted on 2003-11-16
7
Medium Priority
?
866 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
6 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 1000 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 1000 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
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!

 

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

Industry Leaders: 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

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…
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/…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

750 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