I'm overwriting a file using C# in Windows Phone 7. When I do this a seemingly random character is added to the start of each line.

Why is this happening?

Code:

```
public static bool overwriteFile(string filename, string[] inputArray)
    {
        try
        {
            IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();

            FileStream stream = store.OpenFile(filename, FileMode.Create);
            BinaryWriter writer = new BinaryWriter(stream);

            foreach (string input in inputArray)
            {
                writer.Write(input + "\n");
            }

            writer.Close();
            return true;

        }
        catch (IOException ex)
        {
            return false;
        }
    }

```

Lodaing Code:

```
public static Idea[] getFile(string filename)
    {
        try
        {
            IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
            string fileContents = null;
            if (store.FileExists(filename)) // Check if file exists
            {
                IsolatedStorageFileStream save = new IsolatedStorageFileStream(filename, FileMode.Open, store);

                StreamReader streamReader = new StreamReader(save);
                fileContents = streamReader.ReadToEnd();
                save.Close();

            }

            string[] lines = null;
            if (fileContents != null)
            {
                lines = fileContents.Split('\n');
            }

            Idea[] ideaList = null;
            if (lines != null)
            {
                ideaList = new Idea[lines.Length];
                for (int i = 0; i < lines.Length; i++)
                {
                    ideaList[i] = new Idea(lines[i].TrimEnd('\r'));
                }
            }

            return ideaList;
        }
        catch (IOException ex)
        {
            return null;
        }
    }

```