Skip to content

Instantly share code, notes, and snippets.

@kidchenko
Last active September 1, 2020 04:03
Show Gist options
  • Save kidchenko/9629148 to your computer and use it in GitHub Desktop.
Save kidchenko/9629148 to your computer and use it in GitHub Desktop.
Remove non UTF-8 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