summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-15 20:14:07 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-15 20:14:07 +0000
commitcd028baaa42beb359f547c3950a019ed6b46fc80 (patch)
tree7d4075f6eae9b21d121cd3221c17f013c5909843 /sv.h
parent90ec05cef95275d090438d677bea4199a5df35b5 (diff)
downloadperl-cd028baaa42beb359f547c3950a019ed6b46fc80.tar.gz
Better documentation for SVf_UTF8. Including SvPV() 1st, SvUTF() 2nd.
p4raw-id: //depot/perl@29559
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sv.h b/sv.h
index 7e8638fc21..3f061c610a 100644
--- a/sv.h
+++ b/sv.h
@@ -339,8 +339,12 @@ perform the upgrade if necessary. See C<svtype>.
#define PRIVSHIFT 4 /* (SVp_?OK >> PRIVSHIFT) == SVf_?OK */
-#define SVf_AMAGIC 0x10000000 /* has magical overloaded methods */
-#define SVf_UTF8 0x20000000 /* SvPV is UTF-8 encoded */
+#define SVf_AMAGIC 0x10000000 /* has magical overloaded methods */
+#define SVf_UTF8 0x20000000 /* SvPV is UTF-8 encoded
+ This is also set on RVs whose overloaded
+ stringification is UTF-8. This might
+ only happen as a side effect of SvPV() */
+
/* Ensure this value does not clash with the GV_ADD* flags in gv.h */
/* Some private flags. */
@@ -901,6 +905,8 @@ Set the actual length of the string which is in the SV. See C<SvIV_set>.
/*
=for apidoc Am|bool|SvUTF8|SV* sv
Returns a boolean indicating whether the SV contains UTF-8 encoded data.
+Call this after SvPV() in case any call to string overloading updates the
+internal flag.
=for apidoc Am|void|SvUTF8_on|SV *sv
Turn on the UTF-8 status of an SV (the data is not changed, just the flag).