(Hmm... è in Spanish??? Don't you mean é?)
Here is the code snapshot, my $insert_sql = qq! insert into C_LANG_ITEMS (lang_code,key,final_translation) values('ES',:1,:2) !; Here is the data, - Seleccione al menos un término de carga
It could be that you really are getting the utf8 character data into oracle correctly, but maybe you aren't seeing it as utf8 data when you pull it back out. The DBD::Oracle driver might not be setting the utf8 flag on scalar string values that come back from the database.
If that's the case, you may need to do something like:
use Encode; # ... do whatever it takes to query for inserted text, # and assign the "Spanish" string from the DB to $fldvalue ... # the string value from the DB is not flagged as utf8 in Perl, # so set the utf8 flag: my $fldvalue = decode( 'utf8', $fldvalue );
$ENV{NLS_LANG} = "AMERICAN_AMERICA.UTF8";
As to the characters being correctly inserted, try and run a test using module Unicode::MapUTF8
use Unicode::MapUTF8 qw(to_utf8 from_utf8);
...
#convert into utf8
$str = to_utf8({ -string => 'Your string here', -charset => 'ISO-8859-1' });
# TODO: insert into DB
.....
# TODO: select stuff from database, and then
$str = from_utf8({-string => $str_retrieved, -charset => 'ISO-8859-1'});
# TODO: now check the value of $str
perlmonks.org content © perlmonks.org and Anonymous Monk, graff, olus
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03