Util.pm: add to_utf8 function
commit87a6ca2cee3a68c24832a36fb27e4cd6d9c325a9
authorKyle J. McKay <mackyle@gmail.com>
Mon, 20 Apr 2015 01:18:10 +0000 (19 18:18 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 20 Apr 2015 01:18:10 +0000 (19 18:18 -0700)
treeae13d72cc1c87e07d33a920ea2d9b6d7fd5a937c
parentbef1d9bbc56d18ecb4e530ce7a6f409a72106f0d
Util.pm: add to_utf8 function

The to_utf8 function converts its first argument to Perl's
internal character representation be it raw UTF-8 bytes,
something already in Perl's internal character representation
(in which case it's not converted) or some ISO-8859-1 characters.

Optionally the result can be turned back into a string
of raw UTF-8 encoded bytes by providing a second argument
that evaluates to a true value.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Util.pm