problems getting Hebrew strings from Oracle

problems getting Hebrew strings from Oracle

am 28.04.2006 17:27:51 von sagivba

------=_Part_3214_6504336.1146238071382
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi all,
I have 2 machines: linux_perl_machine and sql_server (Oracle 9i).

I am trying to connect from the perl machine to the sql_server and execute =
:
"select Hebrew from Hebrew_Table" ,
but all I get is somthing like: '???? ??????'

The perl machine is not local and I work on it via ssh.
The db encoding is logical and the linux_perl_machine is:

LANG=3Dhe_IL.UTF-8
LC_CTYPE=3Dhe_IL.UTF-8
LC_NUMERIC=3Dhe_IL.UTF-8
LC_TIME=3Den_GB.UTF-8
LC_COLLATE=3Dhe_IL.UTF-8
LC_MONETARY=3Dhe_IL.UTF-8
LC_MESSAGES=3Dhe_IL.UTF-8
LC_PAPER=3Dhe_IL.UTF-8
LC_NAME=3Dhe_IL.UTF-8
LC_ADDRESS=3Dhe_IL.UTF-8
LC_TELEPHONE=3Dhe_IL.UTF-8
LC_MEASUREMENT=3Dhe_IL.UTF-8
LC_IDENTIFICATION=3Dhe_IL.UTF-8
LC_ALL=3D


any ideas?

--
Blue Skies Cler Air
Sagiv

------=_Part_3214_6504336.1146238071382--

RE: problems getting Hebrew strings from Oracle

am 28.04.2006 17:47:28 von Philip.Garrett

-----Original Message-----
From: Sagiv Barhoom [mailto:sagivba@gmail.com]=20
Sent: Friday, April 28, 2006 11:28 AM
To: dbi-users@perl.org
Subject: problems getting Hebrew strings from Oracle

> Hi all,
> I have 2 machines: linux_perl_machine and sql_server (Oracle 9i).
>=20
> I am trying to connect from the perl machine to the sql_server and
execute :
> "select Hebrew from Hebrew_Table" ,
> but all I get is somthing like: '???? ??????'

Non-latin character sets are represented with question marks by some
terminal
emulators (SecureCRT for one). You haven't said exactly where you're
seeing
"???? ??????". Is it in your terminal window? In the browser in some
web
application?

One way to find out if you're actually getting the right strings back
from the
database is to use Data::Dumper like this:

use Data::Dumper;
=20
while (my ($hebrew) =3D $sth->fetchrow) {
print Dumper($hebrew);
}

If you see '$VAR1 =3D "???? ??????"' then you probably have a client
encoding
problem (see below).

If you see something like '$VAR1 =3D "\x{12c}\x{25a}..."' (the idea =
being
the
characters are Unicode, not actual question marks) then your problem is
simply
the program you're using to view the query results.

> The perl machine is not local and I work on it via ssh.
> The db encoding is logical and the linux_perl_machine is:
>=20
> LANG=3Dhe_IL.UTF-8
[snip]

These will affect how Perl handles locales. They don't really affect the
Oracle client, though. You'll need to set NLS_LANG to get Oracle working
right, e.g.:

export NLS_LANG=3DHEBREW_ISRAEL.AL32UTF8

# might also be necessary:
export NLS_NCHAR=3DAL32UTF8

See
http://search.cpan.org/~pythian/DBD-Oracle-1.17/Oracle.pm#Pe rl_and_Unico
de

hth,
Philip