0

Why does this line GetEncoding("ISO-8859-8").GetBytes(text); raise this exception: Encoding 28598 data could not be found. Make sure you have correct international codeset assembly installed and enabled.

But in release build only?? (Xamarin Forms running the Android build).

And how can I work around it. It is code based on this question, and here is my function (which is in a PCL library):

    public static string RemoveDiacritics(this string text)
    {
        if (text == null)
            return string.Empty;

        byte[] tempBytes;
        tempBytes = System.Text.Encoding.GetEncoding("ISO-8859-8").GetBytes(text);
        string asciiStr = System.Text.Encoding.UTF8.GetString(tempBytes, 0, tempBytes.Length);

        return asciiStr;
    }
}
Community
  • 1
  • 1
noelicus
  • 14,468
  • 3
  • 92
  • 111

1 Answers1

1

I solved this issue selecting Mideast under Project Properties: Project Properties -> Android Options -> Additional supported encodings: "Mideast"

View Image

allanes
  • 21
  • 3