- #!/usr/local/git/bin/perl
- # Test Char Set Issue
- # Tested By : Sivasakthi.kumar
- # IM : Sivasakthikumar@gmail.com
- use DBI;
- use utf8;
- use Encode;
- $string = "FuÔbalÀl";
- $ENV{NLS_LANG} = ".UTF8";
- $ENV{NLS_NCHAR} = "AL32UTF8";
- print "Before Insert DataBase :";
- print "$string";
- my $dbh;
- $dbh = DBI->connect("DBI:Oracle:SID=tosipo;HOST="localhost";PORT=1521",
- teststage,
- SSaih,
- {RaiseError => 1,
- PrintError => 0,
- $sqlquery = "update TEST_ASSESSMENT set RESPONSE = \'$string\' where doc_id = 34 and version_id = \'1.0.0\'";
- print "\nSqlQuery : $sqlquery";
- $sth = $dbh->prepare( "select response from TEST_ASSESSMENT where doc_id = 34 and version_id = '1.0.0'" ) or die $dbh->errstr;
- $sth->execute();
- while ( my($res) = $sth->fetchrow_array )
- {
- # $res = decode("ISO-8859-1", $res);
- #$res = encode("utf8", $res);
- print "\n$res";
- }
- $dbh->commit();
- $dbh->disconnect();
Tuesday, November 18, 2008
UTF-8 Solution
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment