use strict; use warnings; use feature 'say'; use utf8; use Win32; use Encode qw/ encode decode /; use File::Spec::Functions; my $parent = canonpath 'c:/Users/someuser/Documents'; my $folder = 'documentação'; my $path = catdir $parent, $folder; say Win32::GetACP; # 'ANSI Code Page' say Win32::GetOEMCP; # 'OEM Code Page' say 'ok' if -d encode('CP'. Win32::GetACP, $path); say 'ok' if decode('CP'. Win32::GetOEMCP, qx(dir $parent)) =~ /$folder/;