Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4F7D174B0 for ; Sun, 23 Nov 2014 05:44:18 +0000 (UTC) Received: (qmail 61395 invoked by uid 500); 23 Nov 2014 05:44:17 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 61360 invoked by uid 500); 23 Nov 2014 05:44:17 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 61350 invoked by uid 99); 23 Nov 2014 05:44:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Nov 2014 05:44:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ruben@mrbrklyn.com designates 96.57.23.82 as permitted sender) Received: from [96.57.23.82] (HELO mrbrklyn.com) (96.57.23.82) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Nov 2014 05:44:13 +0000 Received: by mrbrklyn.com (Postfix, from userid 1000) id 0284516115B; Sun, 23 Nov 2014 00:42:51 -0500 (EST) Date: Sun, 23 Nov 2014 00:42:51 -0500 From: Ruben Safir To: michael kapelko Cc: modperl@perl.apache.org Subject: Re: Perl + DBD-Oracle, problems with encoding when "PerlHandler Apache::Registry" is in use Message-ID: <20141123054251.GB7883@www.mrbrklyn.com> References: <241c6e761002190242u37f23f21j8218fa33c5a2c1fe@mail.gmail.com> <241c6e761002190247w3cc30fabpb523bc577aad2874@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <241c6e761002190247w3cc30fabpb523bc577aad2874@mail.gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Checked: Checked by ClamAV on apache.org did you ever get this worked out. I'm looking to use perl with my oracle set up. Any tips would be appreciated. Ruben On Fri, Feb 19, 2010 at 05:47:51PM +0700, michael kapelko wrote: > Hello. > Here's a short script I used to find out the problem with the Apache::Registry: > > #!/usr/bin/perl -wT > use strict; > use warnings; > use CGI; > use DBI; > use DBI qw(:sql_types); > use encoding 'utf-8'; > > my $cgi = new CGI; > print $cgi->header(-type � �=> "text/html", > � � � � � � � � � -charset => "utf-8"); > print $cgi->start_html(-lang => "ru-RU", > � � � � � � � � � � � -title => "Title"); > print $cgi->h1("Title"); > my $db = DBI->connect("DBI:Oracle:SID=ELTC;HOST=10.102.101.4", > � � � � � � � � � � �, , {RaiseError => 1, > � � � � � � � � � � � � � � � � � � � � � � � � AutoCommit => 0, > � � � � � � � � � � � � � � � � � � � � � � � � ora_charset => "UTF8"}); > my $query = "select name from swmgr2.vw_switches where sw_id_ip = > 2315046666"; // Selects Russian "name" from DB in UTF-8, because on > the previouse line we asked Oracle to return data to us in UTF-8. > my $stmt = $db->prepare($query); > $stmt->execute(); > my $name; > $stmt->bind_columns(undef, \$name); > $stmt->fetch(); > $stmt->finish(); > $db->disconnect(); > print $cgi->p($name); > print $cgi->end_html(); > > When invoked directly by the shell or in web page WITHOUT "PerlHandler > Apache::Registry", the UTF-8 encoded string in Russian is printed just > fine. But when "PerlHandler Apache::Registry" is used, only ???? are > printed in web page. > Thanks. > > . -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013