|
-
May 18th, 2006, 01:33 PM
#1
Text Encoding
Hello,
When using File.CreateText() for creating a text file, the Unicode (UTF-8) is used. But I need to create a text file using another encoding (namely, Hebrew-Windows), because the created file is supposed to serve an input to another program which can't deal with Unicode. How can I set the desired encoding?
-
May 18th, 2006, 02:15 PM
#2
Re: Text Encoding
You have to deal with concrete code page and stream enconding.
Look at this example for inspiration:
Code:
System.IO.FileStream fs = System.IO.File.OpenWrite("file.txt");
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.GetEncoding(1255)))
{
sw.WriteLine("some text");
}
1255 should be hebrew code page. But I cannot check it. I don't know anything from hebrew language.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
-
May 19th, 2006, 02:57 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|