|
-
Dec 30th, 2005, 07:39 PM
#1
[RESOLVED] WriteAllText encoding for LF/CR
If read a file using;
MyText.Text = System.IO.File.ReadAllText(sourceFile)
and later write a file using;
System.IO.File.WriteAllText(TargetFile, MyText.Text)
The Target file does not contain the LF/CR combination. I've tried qualifying the encoding with the extension System.Text.Encoding.....
e.g. System.IO.File.WriteAllText(TargetFile, MyText.Text,System.Text.Encoding.Ascii)
but I cannot find an encoding that generates the correct output in respect of the end of line return characters.
The output file looks fine in Wordpad, but because of the line breaks, it is one big crunched up lump when I open it in Notepad.
Any ideas?, it's driving me nuts....
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
|