ucwords is one of the core PHP functions which is blissfully oblivious to non-ASCII or non-Latin-1 encodings.* For handling multibyte strings and/or non-ASCII strings, you should use the multibyte aware mb_convert_case:
Here you can try this,
You should use the mb_convert_case
mb_convert_case($str, MB_CASE_TITLE, 'UTF-8')