use strict; use utf8; my $s1 = "short_japanese_text_in_utf8"; open F, "<:encoding(sjis)", "file.txt"; while () { print "found\n" if /$s1/; print index($_, $s1)."\n"; }