1

I do the following in my app:

 File.WriteAllText(OutPutFileName + InPutTitle + ".csv", OutputText, Encoding.UTF8);

 //outputText is a string of data separated by commas with line breaks

When I output with Encoding UTF8 and open the csv in Excel, each data point between commas is in each correct cell. But when I switch to Unicode or UTF32, the commas show up in excel and the data is on one long line.

How do I fix this while having encoding at UTF32 (I want this because I have certain chars that need displaying that don't come out in UTF8).

3
  • does that happen with any kind of delimiter , or only commas? Commented Aug 26, 2011 at 19:08
  • not sure, the app is too big to change delimiters since thats in the sql assembly generation Commented Aug 26, 2011 at 19:11
  • donot know precise but try for default encoding Commented Aug 26, 2011 at 19:13

1 Answer 1

2

You might have to split that up into several lines. Use encoding UTF8 for the commas and other basic stuff, and only use UTF32 for what is needed.

Sign up to request clarification or add additional context in comments.

2 Comments

oh that kinda sucks but makes sense
yeah it messes up if you alter encodings, so thats a no go

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.