use Encode; use Win32::GuiTest qw(FindWindowLike); $WindowTitle="V VM"; #Hardcoded the window title in chinese binmode(STDOUT, ":utf8"); print "$WindowTitle\n"; #===> Here perl prints out some chinese text to the command console, but different from what is given in input file my @hwnd=Win32::GuiTest::FindWindowLike(undef,$WindowTitle); if($hwnd[0]) { print "window found\n"; } else { print "window not found\n"; }