Use Encode::decode to decode your data from whatever encoding it's in to Perl's internal format.
Then, when writing the data out to a file, set the 'utf8' layer to make the data be written in UTF-8.
use Encode;
my $data_from_database = ...;
my $perl_data = decode('ISO-8859-1', $data_from_database);
binmode STDOUT, ':utf8';
print $perl_data;
Answer from zgpmax on Stack OverflowCheckSERP
checkserp.com › encode › utf8
Utf-8 Converter, Utf-8 Encoding and Decoder | CheckSERP
Online Utf-8 converter, easy to use utf-8 encoding and decoder tool. Convert plain text to utf-8 codes and vice versa.
University of Edinburgh
cogsci.ed.ac.uk › ~richard › utf-8.html
UTF-8 Tool
Some browsers may not be able to ... for some characters. Installing more fonts may help. Cutting and pasting does not work reliably in all browsers. When cutting and pasting hex numbers from dump output on little-endian machines (eg x86), beware of byte order problems. Hex numbers should not be prefixed with "0x", "U+", or anything else. Hex and octal UTF-8 byte input ...
Subtitle Tools
subtitletools.com › convert-text-files-to-utf8-online
Convert files to UTF-8: fix broken text encoding
This tool converts text files to unicode UTF-8. It fixes gibberish text, question marks, and mojibake. Supports all text and subtitle files.
r12a
r12a.github.io › app-conversion
Unicode code converter
Helps you convert between Unicode character numbers, characters, UTF-8 and UTF-16 code units in hex, percent escapes,and Numeric Character References (hex and decimal).
Unicodeconvert
unicodeconvert.com › utf8
Online UTF-8 Unicode Converter
🌐🧠 This free online tool lets you convert between human-readable text and its UTF-8 byte/escape representations for inspection, debugging, and learning. Encode text into UTF-8 byte sequences or Unicode escape entities. Decode UTF-8 bytes or escape sequences back into readable text. Inspect how ASCII, emojis, and international characters are actually stored.
PHP
php.net › manual › en › function.utf8-encode.php
PHP: utf8_encode - Manual
This function does not attempt to guess the current encoding of the provided string, it assumes it is encoded as ISO-8859-1 (also known as "Latin 1") and converts to UTF-8. Since every sequence of bytes is a valid ISO-8859-1 string, this never results in an error, but will not result in a useful string if a different encoding was intended. Many web pages marked as using the ISO-8859-1 character encoding actually use the similar Windows-1252 encoding, and web browsers will interpret ISO-8859-1 web pages as Windows-1252.
SubExtractor
subextractor.com › tools › convert-to-utf8
Convert to UTF-8 - Free Online Text Encoding Converter - SubExtractor
Free online tool to convert text files from any encoding to UTF-8 for maximum compatibility.