Case sensitivity oddness & unicode

2003-10-30 Thread William Limratana
I have the following code:

---
sub uniTEST {
my($value,$iter) = @_;
ResW("+before $value ");
return $value;
}

$testval = UniTEST($value,$iter);
ResW("+after $testval");
---

Note that the subroutine is called uniTEST, but I made the call using 
UniTEST.  $value is some unicode string.  I'm not sure if it will work if 
I include it in this email but here it is :

éðZŒO

What happens is, the 2nd print statement has converted some of the string 
values to what looks like UTF8 :

+before éðZŒO
+after éðZŒO

Only some of the characters have been converted - the last 5 are 
untouched, but I think that may be because they have been converted to 
HTML codes.  When I call the function using the right case - uniTEST, 
this does not happen.

Note : I'm using PerlScript under IIS - the ResW function is a wrapper 
for $Resource->Write.  Regular perl won't let this happen because it's 
case sensitive.  Something about using PerlScript and IIS screws that up.

It seems like high range characters that are not high enough to be 
converted to HTML by IIS get converted to UTF8 when passed through a 
function that has been called with the wrong case for it's name.

Will


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ADO DateTimes

2003-10-28 Thread William Limratana
Thanks!
  This worked!

Will

-Original Message-
From: "Steven Manross" <[EMAIL PROTECTED]>
To: "William Limratana" <[EMAIL PROTECTED]>, 
Date: Tue, 28 Oct 2003 09:06:27 -0700
Subject: RE: ADO DateTimes

> I'm guessing here, but if you are using Win32::OLE to call your ADO
> routines, you might get a human-readable date/time by loading the
> Win32::OLE::Variant module, which makes variant conversions for you.
> 
> Hope this helps.
> 
> Steven


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


ADO DateTimes

2003-10-28 Thread William Limratana
Hello,

  I'm retrieving dates from a database using ADO.  What is the integer 
that is returned in date fields?  It doesn't appear to be seconds since 
the epoch.

Thanks,
  William


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ADO returning junk and crashing IIS

2003-10-23 Thread William Limratana
Hi,
  Yes - it works without the utf8().  I found it wasn't doing anything 
for me anyway.  I'm running it using PerlIS, I believe.  It's via the 
perl module for IIS.  I wonder why it was creating garbage data.

Thank you,
  Will


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


ADO returning junk and crashing IIS

2003-10-23 Thread William Limratana
Hello, 

  I am having some problems retrieving data from a database.  When 
retrieving data, I often get garbled information following what I've 
retrieved.  I think it's memory corruption of some kind.  dllhost.exe 
often crashes after 4-5 calls to the page containing the code (at the end 
of this email).

This only seems to be happening on one of my machines.  I'm using Windows 
2000 and the latest mdac, if that should matter.  I use other programs, 
running on this machine and others, which interact with the MS SQL Server 
database on this machine with no problems.

Thank you,
  William


---
begin code
---

use Unicode::String qw(utf8 utf16);
use Win32::OLE qw/CP_UTF8/;
Win32::OLE->Option(CP => CP_UTF8);

my $db, $query;

$query = "Select Test from Unicode_Test";

$Conn = Win32::OLE->new("ADODB.Connection");
$RS   = Win32::OLE->new("ADODB.Recordset");

$DSN = "Provider=sqloledb;Data Source=mymachine;Initial 
Catalog=database;User Id=sa;Password=sa";


$Conn->Open($DSN);

$RS->Open($query, $Conn, 1, 1);

until ($RS->EOF) {
$Response->Write($RS->Fields("Test")->value);
$Response->Write("");

   $RS->MoveNext;}

$RS->Close;
$Conn->Close;


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs