From cd028baaa42beb359f547c3950a019ed6b46fc80 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 15 Dec 2006 20:14:07 +0000 Subject: [PATCH] Better documentation for SVf_UTF8. Including SvPV() 1st, SvUTF() 2nd. p4raw-id: //depot/perl@29559 --- sv.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sv.h b/sv.h index 7e8638f..3f061c6 100644 --- a/sv.h +++ b/sv.h @@ -339,8 +339,12 @@ perform the upgrade if necessary. See C. #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. /* =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). -- 2.7.4