Last active
September 1, 2020 04:03
-
-
Save kidchenko/9629148 to your computer and use it in GitHub Desktop.
Remove non UTF-8 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (string.IsNullOrEmpty(input)) | |
return ""; | |
else | |
{ | |
var bytes = System.Text.Encoding.GetEncoding("iso-8859-8").GetBytes(input); | |
return System.Text.Encoding.UTF8.GetString(bytes); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment