From a01c2350d072fbed081d06ed97941e61c6a921c4 Mon Sep 17 00:00:00 2001 From: John Karr Date: Sun, 11 Feb 2024 12:16:18 -0500 Subject: [PATCH] Tie::File docpatch warning unicode writes are unsafe. --- dist/Tie-File/lib/Tie/File.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/Tie-File/lib/Tie/File.pm b/dist/Tie-File/lib/Tie/File.pm index 13d4fa6839b2..efa5d9b27123 100644 --- a/dist/Tie-File/lib/Tie/File.pm +++ b/dist/Tie-File/lib/Tie/File.pm @@ -11,7 +11,7 @@ use Fcntl 'O_CREAT', 'O_RDWR', 'LOCK_EX', 'LOCK_SH', 'O_WRONLY', 'O_RDONLY'; sub O_ACCMODE () { O_RDONLY | O_RDWR | O_WRONLY } -our $VERSION = "1.07"; +our $VERSION = "1.08"; my $DEFAULT_MEMORY_SIZE = 1<<21; # 2 megabytes my $DEFAULT_AUTODEFER_THRESHHOLD = 3; # 3 records my $DEFAULT_AUTODEFER_FILELEN_THRESHHOLD = 65536; # 16 disk blocksful @@ -2051,6 +2051,13 @@ Changes to the array are reflected in the file immediately. Lazy people and beginners may now stop reading the manual. +=head2 C + +You can read a unicode (UTF-8) file by providing a file handle opened with +the desired encoding. It is not safe to write to one because +the length in bytes and in characters is often different, Tie::File +will miscalculate the length of writes, overwriting parts of other records. + =head2 C What is a 'record'? By default, the meaning is the same as for the