in reply to utf-8 keys in a tied hash cause warning
I don't get the warning message. I also noticed some differences in the content of the resulting dbm file -- the OP version had null bytes where the 'encoded' version had non-null bytes, suggesting that the warning issued by the OP version reflects an actual failure to store the data.use Encode; my $utf8key = "\x{05D0}"; my $usable_key = encode( 'utf8', $utf8key ); dbmopen(my %hash, "/tmp/mydb", 0666) || die "d'oh!"; $hash{$usable_key} = "bar"; dbmclose(%hash);
Having to encode the hash keys like this is certainly a PITA (a minor one, but still). Perhaps the maintainer(s) the various *DBM_File modules can be persuaded to update them so as to handle this properly -- easy enough to do, I'd expect.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: utf-8 keys in a tied hash cause warning
by ikegami (Patriarch) on Aug 04, 2006 at 04:32 UTC | |
|
Re^2: utf-8 keys in a tied hash cause warning
by Anonymous Monk on Aug 04, 2006 at 09:56 UTC | |
by saintmike (Vicar) on Aug 04, 2006 at 16:16 UTC |