#!/usr/bin/perl -w use MIME::Words qw/encode_mimewords/; print encode_mimewords("Hola, Seņor!"); #### Hola, =?ISO-8859-1?Q?Se=C3=B1or?=!