for arabic characters getting question marks while fetching rows from ms sql Database
am 13.04.2006 08:37:56 von Nayeem
------=_NextPart_000_03A9_01C65EDD.F1C43970
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Actually when I fetch records from Database then I getting question marks
for arabic characters, so any one can help me to solve this issue.
my $dbh = DBI->connect("dbi:ODBC:sms", "smser", "smspassword")
|| die "Can't connect to $DBI::errstr";
my $sth = $dbh->prepare( q{
select Messagetype,message,mobilenumber from sms where status=0
}) || die "Can't prepare statement: $DBI::errstr";
my $rc1 = $sth->execute()
|| die "Can't execute the statement : $DBI::errstr";
while (($Messagetype,$message,$mobilenumber) = $sth->fetchrow_array)
{
print "$message \n ";
}
Here printing question marks but in database data is in Arabic.
Thanks.
------=_NextPart_000_03A9_01C65EDD.F1C43970--
Re: for arabic characters getting question marks while fetching rowsfrom ms sql Database
am 13.04.2006 10:22:10 von Alexander
DBD::ODBC does not support Unicode (and thus arabic characters) at all.
You may want to try my patch for DBD::ODBC: README file at
http://www.alexander-foken.de/README.unicode-patch.html , gzip
compressed patch at http://www.alexander-foken.de/unicode-patch.txt.gz .
If you use Oracle or PostgreSQL, don't take the detour via ODBC, use a
native driver like DBD::Oracle (supports Unicode with Oracle 9 and newer
on both client and server) or DBD::Pg (Supports Unicode with a connect
attribute, see documentation of DBD::Pg).
Alexander
On 13.04.2006 08:37, Nayeem (Zajil Com) wrote:
>Actually when I fetch records from Database then I getting question marks
>for arabic characters, so any one can help me to solve this issue.
>
>
>my $dbh = DBI->connect("dbi:ODBC:sms", "smser", "smspassword")
> || die "Can't connect to $DBI::errstr";
>
>my $sth = $dbh->prepare( q{
> select Messagetype,message,mobilenumber from sms where status=0
> }) || die "Can't prepare statement: $DBI::errstr";
>
>my $rc1 = $sth->execute()
> || die "Can't execute the statement : $DBI::errstr";
>
>while (($Messagetype,$message,$mobilenumber) = $sth->fetchrow_array)
> {
> print "$message \n ";
>}
>
>Here printing question marks but in database data is in Arabic.
>
>Thanks.
>
>
>
>
--
Alexander Foken
mailto:alexander@foken.de http://www.foken.de/alexander/