APK errors

In C# the letter ə becomes a question mark

On Azerbaijani Windows the old text table is often 1254. That is the Turkish table. It has ü, ö, ş, ğ, ç, and ı. It does not have ə. Encoding.GetEncoding(1254) cannot store that letter and puts ? in its place.

Make the file and the console UTF-8. Do not write 1254.

  • Write the file like this: File.WriteAllText("metn.txt", "Azərbaycan", new UTF8Encoding(true)).
  • Do not write Encoding.GetEncoding(1254) or Encoding.Default. ə is not there.
  • If the console shows a square, first set Console.OutputEncoding = Encoding.UTF8.
  • An old csc reads the source with the system table. Save the .cs file as UTF-8 with a BOM.
  • If the letter is already ?, code cannot bring it back. Write the text again.
using System.Text;

Console.OutputEncoding = Encoding.UTF8;
File.WriteAllText("metn.txt", "Azərbaycan", new UTF8Encoding(encoderShouldEmitUTF8Identifier: true));

Related guides