Unable to read Turkish characters from text file to string array

I am trying to do some processing of sentences in Turkish, and I am using a text file for a database. But I can not read Turkish characters from a text file, because of this I can not process the data correctly.

string[] Tempdatabase = File.ReadAllLines(@"C:\Users\dialogs.txt");
textBox1.Text = Tempdatabase[5];

Output:

+4
source share
3 answers

You can use Encodingas much as you want. This may ultimately lead to the expected result, but keep in mind that this may not work with other files.

# , Unicode . , - , :

( ) UTF-8. - . , # , , . , .

UTF-8, # .

.html Visual Studio, , ( ASCII)

saveas

+2

, . .

var Tempdatabase =
    File.ReadAllLines(@"C:\Users\dialogs.txt", Encoding.GetEncoding("iso-8859-9"));
+4

, . - ,.net Unicode . :

Unicode (, utf8), .

, :

string[] Tempdatabase = File.ReadAllLines(@"C:\Users\dialogs.txt", Encoding.Default);

Windows.

string[] Tempdatabase = File.ReadAllLines(@"C:\Users\dialogs.txt", Encoding.GetEncoding("Windows-1254");

, Microsoft.

+1

All Articles