There is a bug in Unicode upper() which has been present since 7.2:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=139389

I had thought I had reported it before, but I can't find a record of it.

The attached Perl script illustrates the bug (the script needs DBI).

-- 
Oliver Elphick                                [EMAIL PROTECTED]
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "For the LORD God is a sun and shield; the LORD will 
      give grace and glory; no good thing will he withhold 
      from them that walk uprightly."        Psalms 84:11 
#!/usr/bin/perl -w

use DBI;

my $dsn = "DBI:Pg:dbname=junk;host=localhost";  # change database name
my ($user, $password) = ('olly', ''); # must be modified

my $dbh = DBI->connect($dsn, $user, $password,
		       { PrintError => 1, 
			 RaiseError => 1, 
			 AutoCommit => 1 });

my $sth = $dbh->prepare("select upper(?)");

my $test = "\xc3\xb6"; # lowercase o with diaeresis in utf-8, u+00f6

$sth->execute($test);
my $result = ($sth->fetchrow_array)[0];

if($result ne "\xc3\x96") { # uppercase O with diaeresis, u+00d6
    print "Result $result is wrong\n";
}

$sth->finish;
$dbh->disconnect;
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to