fixes #5450 Tags with Unicode characters

Fixed the issue and pushed the code for review, please check it.