How to read Hebrew letters with StreamReader
-
hi, i have a file with Hebrew letters. while reading the file with:
string s;
SreamReader SR=new StreamReader(Dir);
s= SR.readLine();the string contains: ����� (something strange) and not hebrew letters. how can i receive hebew letters? i have Microsoft Visual Studio 2008 thank you
-
hi, i have a file with Hebrew letters. while reading the file with:
string s;
SreamReader SR=new StreamReader(Dir);
s= SR.readLine();the string contains: ����� (something strange) and not hebrew letters. how can i receive hebew letters? i have Microsoft Visual Studio 2008 thank you
Is your file Unicode? And where do you get this strange output. Keep in mind that you won't get correct Unicode output in console (try to output in a Label for instance). If your file is not Unicode, try passing the Hebrew encoding to the StreamReader constructor.
Regards, Lev
-
hi, i have a file with Hebrew letters. while reading the file with:
string s;
SreamReader SR=new StreamReader(Dir);
s= SR.readLine();the string contains: ����� (something strange) and not hebrew letters. how can i receive hebew letters? i have Microsoft Visual Studio 2008 thank you
-
tinase leishtamesh be ASCI. yahol lehiot she ze yazor leha: TcpClient newClient; byte[] bytes = new byte[1024]; ns = newClient.GetStream(); bytesRead = ns.Read(bytes, 0, bytes.Length); message = Encoding.ASCII.GetString(bytes, 0, bytesRead);
The answer you provide might be valuable for a lot of people, so please, answer in English.
Regards, Lev
-
The answer you provide might be valuable for a lot of people, so please, answer in English.
Regards, Lev
Ok :) Did it help you? Try to use ASCI code. In the past i created chat(server and client) that get stream(text) from tcp connection and show it in textbox. TcpClient newClient; NetworkStream ns; string message=" "; byte[] bytes = new byte[1024]; ns = newClient.GetStream(); bytesRead = ns.Read(bytes, 0, bytes.Length); message = Encoding.ASCII.GetString(bytes, 0, bytesRead);