in reply to Re:^2 DBM modules and unicode keys
in thread DBM modules and unicode keys

Well i would guess that you need to encode the data as you put it in the DB and then decode it when you take it out. The code you have posted suggests that you are trying to extract from a DB created without using an appropriate filter_store_key(). I would delete the db, construct the appropriate store and fetch filters and then try rebuilding it.

Im sorry I cant help more than that, im not too familiar with the ins and outs of UTF8, but this is definately where I would start to try to solve the problem.

--- demerphq
my friends call me, usually because I'm late....

Replies are listed 'Best First'.
Re:^4 DBM modules and unicode keys
by ph0enix (Friar) on Nov 23, 2002 at 11:18 UTC

    By reading docs again and again I found my mistake. The $_ variable must be modified instead of returning value, because the return code from the filter is ignored. Thank you

    The correct filtering function is

    (tied %data)->filter_fetch_key( sub { $_ = decode('utf8', $_); } );