6.4.2 Decoding File Path Strings

The binary strings that could be accessed correspond to the customization variables strings or arrays INCLUDE_DIRECTORIES, CSS_FILES, MACRO_EXPAND and INTERNAL_LINKS. If they need to be decoded into character strings, for example to appear in error messages, it is possible to use the COMMAND_LINE_ENCODING customization variable value as encoding name to mimic how the decoding of these strings from the command line is done in the main program and in the converters. For example:

my $macro_expand_fname = $self->get_conf('MACRO_EXPAND');
my $encoding = $self->get_conf('COMMAND_LINE_ENCODING');
if (defined($encoding)) {
  $macro_expand_fname = Encode::decode($encoding, $macro_expand_fname);
}

More information on perl and encodings in perlunifaq.