Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 34100 invoked from network); 19 Feb 2010 10:48:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Feb 2010 10:48:21 -0000 Received: (qmail 92010 invoked by uid 500); 19 Feb 2010 10:48:20 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 91974 invoked by uid 500); 19 Feb 2010 10:48:20 -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 91965 invoked by uid 99); 19 Feb 2010 10:48:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Feb 2010 10:48:20 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kornerr@gmail.com designates 209.85.223.204 as permitted sender) Received: from [209.85.223.204] (HELO mail-iw0-f204.google.com) (209.85.223.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Feb 2010 10:48:12 +0000 Received: by iwn42 with SMTP id 42so689740iwn.6 for ; Fri, 19 Feb 2010 02:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MAOjZe6dqf5NMu8xbtn5iUR3j65WKSC4B81rGtWacVY=; b=AlKuEVGYIn97KEKgSBxFGJYhjiDHshbTFtzturHLsGod54uZs7u0r1vYq6arWcUDNw VcOdc7tMfLlBwjExnoqvp/zjGVfAv3heddjAfekK/NW9625J6c+EgrBKgB7BJBN1uVCe v+ksVF571lFwHxDqvhQmFTmv3tbZDOrAg2Vr8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=do3hls0MYEzB0FaFw3rt95iKAhFS7cb1RpTTPmYK2PPqF8/RNywdzfuSRL9VXmv2er LjvTUvYR7CzMdVBeAHScSDoNRV2RYkE3KkCHea4Q2QgtQ9PUSEeWcqTU17qECBBEUrUD b48xI+jrLe9UHoZAoINhlLIyzLIFLiuRtarjI= MIME-Version: 1.0 Received: by 10.231.191.131 with SMTP id dm3mr46947ibb.45.1266576471410; Fri, 19 Feb 2010 02:47:51 -0800 (PST) In-Reply-To: <241c6e761002190242u37f23f21j8218fa33c5a2c1fe@mail.gmail.com> References: <241c6e761002190242u37f23f21j8218fa33c5a2c1fe@mail.gmail.com> Date: Fri, 19 Feb 2010 17:47:51 +0700 Message-ID: <241c6e761002190247w3cc30fabpb523bc577aad2874@mail.gmail.com> Subject: Perl + DBD-Oracle, problems with encoding when "PerlHandler Apache::Registry" is in use From: michael kapelko To: modperl@perl.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello. Here's a short script I used to find out the problem with the Apache::Regis= try: #!/usr/bin/perl -wT use strict; use warnings; use CGI; use DBI; use DBI qw(:sql_types); use encoding 'utf-8'; my $cgi =3D new CGI; print $cgi->header(-type =A0 =A0=3D> "text/html", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -charset =3D> "utf-8"); print $cgi->start_html(-lang =3D> "ru-RU", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -title =3D> "Title"); print $cgi->h1("Title"); my $db =3D DBI->connect("DBI:Oracle:SID=3DELTC;HOST=3D10.102.101.4", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0, , {Rai= seError =3D> 1, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 AutoCommit =3D> 0, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 ora_charset =3D> "UTF8"}); my $query =3D "select name from swmgr2.vw_switches where sw_id_ip =3D 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 =3D $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.