You need to encode back to octets the return of Win32::GetLongPathName()
, because say
is printing out octets. Win32::FindFile
is most likely doing that for you already.
Which encoding you choose should depend on what your console expects (to be able to redisplay the characters).
perl -MEncode -E "say encode( 'UTF-8', Win32::GetLongPathName( $_ ) )
+for glob '*'"
doesn't work out, choose another encoding that works well with your console. Bear in mind that the UTF-8 encoding may be fine as-is, and that the console just needs better fonts (which is not your case, because I infer that you can see the characters displayed properly using Win32::FindFile