Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:01:06+00:00 2026-05-27T15:01:06+00:00

File.WriteAllText is inserting a space after every letter and quotation. Example: Original File JobID

  • 0

File.WriteAllText is inserting a space after every letter and quotation.

Example:

Original File

"JobID" "ParentJobID"

New File

" J o b I D "    " P a r e n t J o b I D "

CODE

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProcessOutputLogTransfer
{
    class Program
    {
        static void Main(string[] args)
        {

            string content = File.ReadAllText(@"C:\Documents and Settings\All Users\Application Data\Microsoft\Windows NT\MSFax\ActivityLog\OutboxLOG.txt");

        File.WriteAllText(@"C:\FAXLOG\OutboxLOG.txt", content, Encoding.UTF8);
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:01:07+00:00Added an answer on May 27, 2026 at 3:01 pm

    I don’t think it’s WriteAllText that’s doing this. I believe it’s ReadAllText, which defaults to reading using UTF-8 – I suspect your OutboxLOG.txt file is actually written in UTF-16, instead. Try this:

    string inputPath = @"C:\Documents and Settings\All Users\Application Data\"
                     + @"Microsoft\Windows NT\MSFax\ActivityLog\OutboxLOG.txt";
    string outputPath = @"C:\FAXLOG\OutboxLOG.txt";
    
    string content = File.ReadAllText(inputPath, Encoding.Unicode);
    File.WriteAllText(outputPath, content, Encoding.UTF8);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I'm writing a very long string to a file using File.WriteAllText, and another
When I do WebClient wc = new WebClient(); string content = wc.DownloadString(url); File.WriteAllText(path, content);
this is the code in question: using (var file = MemoryMappedFile.OpenExisting(AIDA64_SensorValues)) { using (var
the code: static void Main(string[] args) { Console.WriteLine(Memory mapped file reader started); using (var
foreach (var f in new DirectoryInfo(@...).GetFiles(*.cs, SearchOption.AllDirectories)) { string s = File.ReadAllText(f.FullName); File.WriteAllText (f.FullName,
i have code to save a file like SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter
I am trying to write a txt file from C# as follows: File.WriteAllText(important.txt, Convert.ToString(c));
File is sent to the client using Response.writefile and content diposition as inline. When
FILE *out=fopen64(text.txt,w+); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf(%i\n,ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf(%i\n,write); printf(%i\n,ftello64(out));
file.txt contains: ##w## ##wew## using mac 10.6, bash shell, the command: cat file.txt |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.