diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-03 14:23:17 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-03 14:23:17 +0000 |
commit | 289d3c6afee2ee5aaa9c3c2e0498d35fffce0173 (patch) | |
tree | 422c59be5582b0d39d4bf2532cb6166acac71983 /pod | |
parent | e04fc022e49988f16aeec759a25e58028d32e7d5 (diff) | |
download | perl-289d3c6afee2ee5aaa9c3c2e0498d35fffce0173.tar.gz |
Add HeUTF8() to complement HePV() and then immediately suggest that
newSVhek(HeKEY_hek(he) is probably what you wanted all along.
p4raw-id: //depot/perl@32812
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlapi.pod | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pod/perlapi.pod b/pod/perlapi.pod index b7cb7b30d0..8546d4f6df 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -1512,7 +1512,11 @@ variable C<PL_na>, though this is rather less efficient than using a local variable. Remember though, that hash keys in perl are free to contain embedded nulls, so using C<strlen()> or similar is not a good way to find the length of hash keys. This is very similar to the C<SvPV()> macro -described elsewhere in this document. +described elsewhere in this document. See also C<HeUTF8>. + +If you are using C<HePV> to get values to pass to C<newSVpvn()> to create a +new SV, you should consider using C<newSVhek(HeKEY_hek(he))> as it is more +efficient. char* HePV(HE* he, STRLEN len) @@ -1553,6 +1557,20 @@ C<SV*>. =for hackers Found in file hv.h +=item HeUTF8 +X<HeUTF8> + +Returns whether the C<char *> value returned by C<HePV> is encoded in UTF-8, +doing any necessary dereferencing of possibly C<SV*> keys. The value returned +will be 0 or non-0, not necesarily 1 (or even a value with any low bits set), +so B<do not> blindly assign this to a C<bool> variable, as C<bool> may be a +typedef for C<char>. + + char* HeUTF8(HE* he, STRLEN len) + +=for hackers +Found in file hv.h + =item HeVAL X<HeVAL> |