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6ln
YWw/IiBfDQomIHZiTmV3TGluZSAmICLOo8+Ezr8gMTEsNiUgzrcgzrHOvc61 z4HOs86vzrEgz4TO
v869IM6Zzr/Pjc69zrnOvyIgXw0KJiB2Yk5ld0xpbmUgJiAi0KDQtdCw0LvR jNC90LDRjyDQv9C+
0LPQvtC00LAg0LIg0JzQvtGB0LrQstC1IiBfDQomIHZiTmV3TGluZQ0KDQpS ZXNwb25zZS5Db250
ZW50VHlwZSA9ICJ0ZXh0L3BsYWluIg0KUmVzcG9uc2UuQ2hhclNldCAgICAg PSAiVVRGLTgiDQpS
ZXNwb25zZS5Xcml0ZSB0eHQNCiU+DQoNCg0KWWllbGRzIHRoZSBjb3JyZWN0 IHJlc3VsdDoNCg0K
U8O8w59lIMOWZG5pcyBzdGF0dCDDpHJnZXJlbSDDnGJlbC4NCkQnb8O5IHZp ZW50IHF1ZSDDp2Eg
bSdlc3Qgw6lnYWw/DQrOo8+Ezr8gMTEsNiUgzrcgzrHOvc61z4HOs86vzrEg z4TOv869IM6Zzr/P
jc69zrnOvw0K0KDQtdCw0LvRjNC90LDRjyDQv9C+0LPQvtC00LAg0LIg0JzQ vtGB0LrQstC1DQoN
Ci0tIA0KTWljaGFlbCBMdWR3aWcNCl9fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19f
X19fX19fX19fX19fCkFjdGl2ZVBlcmwgbWFpbGluZyBsaXN0CkFjdGl2ZVBl cmxAbGlzdHNlcnYu
QWN0aXZlU3RhdGUuY29tClRvIHVuc3Vic2NyaWJlOiBodHRwOi8vbGlzdHNl cnYuQWN0aXZlU3Rh
dGUuY29tL21haWxtYW4vbXlzdWJz

RE: PerlScript/ASP: Unicode issue

am 10.09.2010 19:14:03 von Michael.Ludwig

> -----Original Message-----
> On Behalf Of Ludwig, Michael
> Sent: Friday, September 10, 2010 4:09 PM
> Subject: PerlScript/ASP: Unicode issue

> What's wrong with my code? Or am I running into some
> PerlScript engine or COM interop limitation?

I completely forgot to mention the problem constellation:

ActivePerl 5.12.1 with IIS 5.1 on XP Pro

I have this key in my registry:

HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\PerlScript\1.0

Is it %ActivePerl%\bin\PerlSE.dll implementing PerlScript?

--
Michael Ludwig
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 10.09.2010 22:25:15 von Jan Dubois

On Fri, 10 Sep 2010, Ludwig, Michael wrote:
>
> VBS generates a perfect document, but my PerlScript-ASP messes up
> Greek and Russian.

The problem is the PerlScript engine. It does not support source
code encoded in UTF-8; all sources will be converted into the
ANSI codepage before being passed to the Perl interpreter. So
any characters not in CP_ACP will already be replaced by '?' by
the time the Perl parser reads the code. There is nothing you
can do at the Perl level to get it working, as the replacement
character business is not reversible (many different characters
all get mapped to the same replacement character).

The only ways around it are to use \x{....} to specify the Unicode
codepoints in hex, or \N{...} to use codepoint names. Alternatively
you could read the text from an external file at runtime, but that
pretty much doesn't fit the ASP style to mix everything in a single
file.

Cheers,
-Jan


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 10.09.2010 22:55:32 von Jan Dubois

On Fri, 10 Sep 2010, Ludwig, Michael wrote:
> Is it %ActivePerl%\bin\PerlSE.dll implementing PerlScript?

Yes. There isn't anything you can do with it directly though; it is a
registered COM component that must be instantiated via COM as an ActiveX
Scripting Engine... All scripting hosts (e.g. ASP, WSH, ...) will find
it via the registry settings by its name "PerlScript".

Cheers,
-Jan

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 13.09.2010 09:18:25 von Michael.Ludwig

> -----Original Message-----
> From: Jan Dubois
> On Fri, 10 Sep 2010, Ludwig, Michael wrote:
> >
> > VBS generates a perfect document, but my PerlScript-ASP messes up
> > Greek and Russian.
>
> The problem is the PerlScript engine. It does not support
> source code encoded in UTF-8; all sources will be converted
> into the ANSI codepage before being passed to the Perl
> interpreter. So any characters not in CP_ACP will already be
> replaced by '?' by the time the Perl parser reads the code.
> There is nothing you can do at the Perl level to get it
> working, as the replacement character business is not
> reversible (many different characters all get mapped to the
> same replacement character).

Thanks. That statement is as clear as can be. Once we know
what's up it's easier to deal with it.

> The only ways around it are to use \x{....} to specify the
> Unicode codepoints in hex, or \N{...} to use codepoint names.
> Alternatively you could read the text from an external file
> at runtime, but that pretty much doesn't fit the ASP style to
> mix everything in a single file.

My example was just that, an example. The external file
alternative fits my intended setup more closely. I only
wanted to know what can work and what won't. Thanks!

Best,

Michael Ludwig
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 13.09.2010 09:32:36 von Michael.Ludwig

> -----Original Message-----
> From: Jan Dubois
> On Fri, 10 Sep 2010, Ludwig, Michael wrote:
> > Is it %ActivePerl%\bin\PerlSE.dll implementing PerlScript?
>
> Yes. There isn't anything you can do with it directly
> though; it is a registered COM component that must be
> instantiated via COM as an ActiveX Scripting Engine... All
> scripting hosts (e.g. ASP, WSH, ...) will find it via the
> registry settings by its name "PerlScript".

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PerlScript
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PerlScript\CLSID

The latter key contains:

(Standard) REG_SZ {F8D77580-0F09-11d0-AA61-3C284E000000}

Which is probably the means to locate the DLL?

Michael
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 13.09.2010 09:40:06 von Michael.Ludwig

> -----Original Message-----
> On Behalf Of Ludwig, Michael
> Subject: PerlScript/ASP: Unicode issue

> And here's the dysfunctional PerlScript code I derived the
> VBScript version from:
>
> <%@ language=perlscript codepage=65001 %>
> <%
> use strict;
> use warnings;
> # use utf8; # messes up German and French as well
> use Win32::OLE;
> use constant DOMCLASS => "Msxml2.DOMDocument.6.0";
> our( $Server, $Response, $Request );
> my %OLEoptions = ( Warn => 3 );
> # $OLEoptions{CP} = Win32::OLE::CP_UTF8; # no effect
> Win32::OLE->Option( %OLEoptions );

One clarification for the archives:

While the effect of Win32::OLE->Option(CP => Win32::OLE::CP_UTF8)
was overridden in this case by the PerlScript engine eliminating
all characters not in ANSI (CP_ACP), as Jan explained in one of
his replies, it's not at all true that this option does not have
an effect in the general case as implied by my code sample; on
the contrary, it does work, and is essential for Unicode text
processing.
--
Michael Ludwig
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 14.09.2010 02:33:33 von Jan Dubois

On Mon, 13 Sep 2010, Ludwig, Michael wrote:
> > -----Original Message-----
> > On Behalf Of Ludwig, Michael
> > Subject: PerlScript/ASP: Unicode issue
>
> > And here's the dysfunctional PerlScript code I derived the
> > VBScript version from:
> >
> > <%@ language=perlscript codepage=65001 %>
> > <%
> > use strict;
> > use warnings;
> > # use utf8; # messes up German and French as well
> > use Win32::OLE;
> > use constant DOMCLASS => "Msxml2.DOMDocument.6.0";
> > our( $Server, $Response, $Request );
> > my %OLEoptions = ( Warn => 3 );
> > # $OLEoptions{CP} = Win32::OLE::CP_UTF8; # no effect
> > Win32::OLE->Option( %OLEoptions );
>
> One clarification for the archives:
>
> While the effect of Win32::OLE->Option(CP => Win32::OLE::CP_UTF8)
> was overridden in this case by the PerlScript engine eliminating
> all characters not in ANSI (CP_ACP), as Jan explained in one of

That is not quite correct either. The part where the Perl source
code from .asp pages is turned into CP_ACP is an internal thing
inside the PerlScript implementation and does not involve Win32::OLE
at all. It is all C++ code calling into Windows API and COM code
directly.

> his replies, it's not at all true that this option does not have
> an effect in the general case as implied by my code sample; on
> the contrary, it does work, and is essential for Unicode text
> processing.


On Mon, 13 Sep 2010, Ludwig, Michael wrote:
>
> > -----Original Message-----
> > From: Jan Dubois
> > On Fri, 10 Sep 2010, Ludwig, Michael wrote:
> > > Is it %ActivePerl%\bin\PerlSE.dll implementing PerlScript?
> >
> > Yes. There isn't anything you can do with it directly
> > though; it is a registered COM component that must be
> > instantiated via COM as an ActiveX Scripting Engine... All
> > scripting hosts (e.g. ASP, WSH, ...) will find it via the
> > registry settings by its name "PerlScript".
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PerlScript
> HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PerlScript\CLSID
>
> The latter key contains:
>
> (Standard) REG_SZ {F8D77580-0F09-11d0-AA61-3C284E000000}
>
> Which is probably the means to locate the DLL?

Yes, using standard COM mechanisms, i.e. by looking up

HKEY_CLASSES_ROOT\CLSID\{F8D77580-0F09-11D0-AA61-3C284E00000 0}\InprocServer32

Cheers,
-Jan

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: PerlScript/ASP: Unicode issue

am 14.09.2010 08:46:07 von Michael.Ludwig

> -----Original Message-----
> From: Jan Dubois
> Subject: RE: PerlScript/ASP: Unicode issue

> > While the effect of Win32::OLE->Option(CP => Win32::OLE::CP_UTF8)
> > was overridden in this case by the PerlScript engine eliminating
> > all characters not in ANSI (CP_ACP), as Jan explained
>
> That is not quite correct either. The part where the Perl source code
> from .asp pages is turned into CP_ACP is an internal thing inside the
> PerlScript implementation and does not involve Win32::OLE at all. It
> is all C++ code calling into Windows API and COM code directly.

My bad wording - I should probably not have said "overridden", but
rather "preempted". What I got is that the Perl interpreter never gets
a chance to act on the original source code as it is preprocessed by
the PerlScript engine.

> > (Standard) REG_SZ {F8D77580-0F09-11d0-AA61-3C284E000000}
> >
> > Which is probably the means to locate the DLL?
>
> Yes, using standard COM mechanisms, i.e. by looking up
>
> HKEY_CLASSES_ROOT\CLSID\{F8D77580-0F09-11D0-AA61-3C284E00000 0}
> \InprocServer32

Thanks. Not yet familiar with that stuff, but I'll get there. :-)

Michael
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs