Fix [string tolower] buffer overflow for non-utf8

Reported-by: Andy <jimdevel@hummypkg.org.uk>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
file copy -force handles identical source/target

No longer truncates the file

Reported-by: sg0x40 <https://github.com/sg0x40>
Signed-off-by: Steve Bennett <steveb@workware.net.au>