in reply to How to convert hash keys to utf8
If you can change the original hash, I suggest this code snippet, which deletes entries with the non-utf8 keys and reuses the values for the utf8-version key.
for (keys %oldhash) { # change key and keep the value $oldhash{utf8_on($_)} = delete $oldhash{$_}; } call_pyfunc(\%oldhash);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to convert hash keys to utf8
by soonix (Chancellor) on Sep 24, 2021 at 08:51 UTC | |
Re^2: How to convert hash keys to utf8
by mpersico (Monk) on Sep 23, 2021 at 17:44 UTC |