Solved

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

Posted on 2003-11-16
7
839 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
[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
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

726 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