I want to compare strings in Persian (utf8). I know I must use some thing like L\"گل\" and it must be saved in wchar_t * or wstring. the question is when I compare by the fu
wchar_t is not for UTF-8, but (depending on the platform) typically either UTF-16 or UCS-32. If you want to work on UTF-8, use plain old char * or string, and their comparison functions for equality. If you want human-meaingful sorting, it gets much more involved (no matter which encoding you use).