diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-09-11 21:41:32 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-12-06 12:49:49 -0700 |
commit | 6bfe0388956736a32b874cc5e31cc6437260b227 (patch) | |
tree | d158373dd08158abaf1859ff5c975a404e937bca /pod/perlhacktips.pod | |
parent | 176fe009d87e3a7dbf597e083a7c6376db79446c (diff) | |
download | perl-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.pod | 10 |
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 |