summaryrefslogtreecommitdiff
path: root/pod/perlhacktips.pod
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-09-11 21:41:32 -0600
committerKarl Williamson <public@khwilliamson.com>2013-12-06 12:49:49 -0700
commit6bfe0388956736a32b874cc5e31cc6437260b227 (patch)
treed158373dd08158abaf1859ff5c975a404e937bca /pod/perlhacktips.pod
parent176fe009d87e3a7dbf597e083a7c6376db79446c (diff)
downloadperl-6bfe0388956736a32b874cc5e31cc6437260b227.tar.gz
perlhacktips: Note sprintf glibc bug and workarounds
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2013-09/msg00506.htmlP
Diffstat (limited to 'pod/perlhacktips.pod')
-rw-r--r--pod/perlhacktips.pod10
1 files changed, 9 insertions, 1 deletions
diff --git a/pod/perlhacktips.pod b/pod/perlhacktips.pod
index 4e4bbc2347..0112751d07 100644
--- a/pod/perlhacktips.pod
+++ b/pod/perlhacktips.pod
@@ -605,7 +605,15 @@ Do not use sprintf() or vsprintf()
If you really want just plain byte strings, use my_snprintf() and
my_vsnprintf() instead, which will try to use snprintf() and
vsnprintf() if those safer APIs are available. If you want something
-fancier than a plain byte string, use SVs and Perl_sv_catpvf().
+fancier than a plain byte string, use
+L<C<Perl_form>()|perlapi/form> or SVs and
+L<C<Perl_sv_catpvf()>|perlapi/sv_catpvf>.
+
+Note that some versions of all the C<sprintf()> forms are buggy in
+glibc as of version 2.17. They won't allow a C<%s> format to create a
+string that isn't valid UTF-8 if the current underlying locale of the
+program is UTF-8. What happens is that the C<%s> and its operand are
+simply skipped without any notice.
=back