fixing UnicodeEncodeError when searching, close #11941 (rebased onto dev_5_0)



This is the same as gh-2033 but rebased onto dev_5_0.

----

in order to test type 'tętnica' the word from the qa feedback.