There is a problem exporting accented characters in text files. Some programs cannot import or correctly display accented characters. Therefore you need to use encoding to correctly export a plain text file. However, there are a LOT of encodings, so which one should you use?
The answer is: iso-8859-8.
That is the Hebrew (ISO-Visual) encoding. The encoding is natively supported in .NET. It intelligently converts to a visual format for you. The other standard encoders do not do this as you will see below.
Converting the following: Frédéric François.
||Western European (ISO)
||Western European (Windows)
Example of Code Using Encoding
StreamWriter sw = new StreamWriter
("somefile.txt", false, System.Text.Encoding.GetEncoding("iso-8859-8"));
A Full Example for the Beginner
using (StreamWriter sw = new StreamWriter
("somefile.txt", false, System.Text.Encoding.GetEncoding("iso-8859-8")))
DataSet1TableAdapters.binsTA ta = new DataSet1TableAdapters.binsTA();
DataSet1.binsDataTable dt = ta.GetData();
foreach (DataSet1.binsRow row in dt.Rows)
- 22nd May, 2007: Initial post
C++ and C# Developer for 21 years. Microsoft Certified.
UK Senior software developer / team leader.
I've been writing software since 1985. I pride myself on designing and creating software that is first class. That means it has to be fast, scalable, and with good use of design patterns.
I have done everything from risk analysis and explosion modelling, banking systems, to highly scalable multi-threaded arrival and departure screens in many leading airports, to state of the art wireless warehouse systems.