From d24bd4f87aa4426a74120f150fa37c2c930f1f86 Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Mon, 11 Apr 2016 14:51:57 +0200 Subject: [PATCH] Made it explicit that inputs might be changed This patch adds a few lines in the docs for encode(), decode() and decode_utf8() to make it explicit to the reader that their inputs might be at risk of being modified. This information is already contained in the docs, although it's a bit easy to overlook it; the goal of the patch is to make anyone reading the docs for one of those functions immediately aware that their inputs might be at risk unless proper actions are taken. --- Encode.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Encode.pm b/Encode.pm index ff868a5..19a0d2e 100644 --- a/Encode.pm +++ b/Encode.pm @@ -468,6 +468,10 @@ I and returns a sequence of octets. I can be either a canonical name or an alias. For encoding names and aliases, see L. For CHECK, see L. +B: the input scalar I might be modified in-place depending +on what is set in CHECK. See L if you want your inputs to be +left unchanged. + For example, to convert a string from Perl's internal format into ISO-8859-1, also known as Latin1: @@ -492,6 +496,10 @@ I can be either a canonical name or an alias. For encoding names and aliases, see L; for I, see L. +B: the input scalar I might be modified in-place depending +on what is set in CHECK. See L if you want your inputs to be +left unchanged. + For example, to convert ISO-8859-1 data into a string in Perl's internal format: @@ -607,6 +615,10 @@ Because not all sequences of octets are valid UTF-8, it is quite possible for this function to fail. For CHECK, see L. +B: the input I<$octets> might be modified in-place depending on +what is set in CHECK. See L if you want your inputs to be +left unchanged. + =head2 Listing available encodings use Encode;