I have a utf-8 file containing some Turkish text inside. (My system is MacOSX)
$ file -I foo.merge $foo.merge: text/plain; charset=utf-8
When I try to see some Turkish specific characters by using
grep, there is no problem:
$ grep 'Emiroğlu' foo.merge EMİROĞLU Emiroğlu+Noun+A3sg+Pnon+Nom Emiroğlu+Noun+Prop+Noun+A3sg+P3sg+Nom Emiroğlu+Noun+Prop+Noun+A3sg+Pnon+Nom NOTFOUND
I can also see the file by using
less command without any problem.
However if I try to do the following, the Turkish characters are not seen properly:
$ grep 'Emir' foo.merge | less EMİROĞLU ESC[1;35;40mESC[KEmirESC[mESC[Koğlu+Noun+A3sg+Pnon+Nom ESC[1;35;40mESC[KEmirESC[mESC[Koğlu+Noun+Prop+Noun+A3sg+P3sg+Nom ESC[1;35;40mESC[KEmirESC[mESC[Koğlu+Noun+Prop+Noun+A3sg+Pnon+Nom NOTFOUND
Or the following also doesn't work:
$grep 'Emir' foo.merge > foo2.out $less foo2.out
What could be the problem? Here is some additional information:
$ locale LANG="en_US.utf-8" LC_COLLATE="en_US.utf-8" LC_CTYPE="en_US.utf-8" LC_MESSAGES="en_US.utf-8" LC_MONETARY="en_US.utf-8" LC_NUMERIC="en_US.utf-8" LC_TIME="en_US.utf-8" LC_ALL="en_US.utf-8"