mpersico has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to set the keys to utf8 in XS? I was hoping for a HeKEY macro, but doing some poking around, I only see keys being retrieved, not set.
Failing that, would a simple:
seem to be the right thing to do?my %newhash; for (keys %oldhash) { $newhash{utf8_on($_)} = $newhash{$_}; } call_pyfunc(\%newhash);
Thank you.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to convert hash keys to utf8
by NERDVANA (Priest) on Sep 22, 2021 at 06:34 UTC | |
Re: How to convert hash keys to utf8
by hexcoder (Curate) on Sep 23, 2021 at 09:35 UTC | |
by soonix (Chancellor) on Sep 24, 2021 at 08:51 UTC | |
by mpersico (Monk) on Sep 23, 2021 at 17:44 UTC | |
Re: How to convert hash keys to utf8
by mpersico (Monk) on Sep 23, 2021 at 18:06 UTC |