hi guys.
I have a program where the users do many many many things, but one of those things is enter text. Specifically, name of an artist/band, song name, album, etc.
I need to allow the user to encode the output text file to ANSI or UTF-8.
I have StreamWriter doing that with the following code
StreamWriter swSongsDta; if (mMainForm.EncodeUTF8) { swSongsDta = new StreamWriter(fsongsdta, false, System.Text.Encoding.UTF8); } else { swSongsDta = new StreamWriter(fsongsdta, false, System.Text.Encoding.Default); }
this creates the file in the correct format, according to NotePad++. However, the accented character from the input string (from a textbox) shows up wrong in both ANSI or UTF8 formatting.
for my testing i'm using Michael Bublé. the é fails to show correctly in either encoding.
is this because the file is encoding in UTF8/ANSI but not the text being written to it? if so, how can I convert/encode the string prior to passing it to StreamWriter?
thanks!