Solved

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

Posted on 2003-11-16
7
792 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
Comment Utility
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
Comment Utility
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
Comment Utility
Can you explain how to post using unicode?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:txtphile
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

7 Experts available now in Live!

Get 1:1 Help Now