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 9078181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:33:22+00:00 2026-06-16T19:33:22+00:00

I have RTF that is being mis-interpreted. StringWriter takes a \t and replaces it

  • 0

I have RTF that is being mis-interpreted. StringWriter takes a \t and replaces it with some character that RichTextBox cannot deal with inside a table.

string rtfBeforeConversion = @"{\rtf1{\trowd\cellx1150 \cellx3750 \cellx7350 Temp\intbl\cell 96 - 99.7\t\intbl\cell 97.9\t\intbl\cell \row}}";
string rtfBrokenByConversion = @"{\rtf1{\trowd\cellx1150 \cellx3750 \cellx7350 Temp\intbl\cell 96 - 99.7    \intbl\cell 97.9    \intbl\cell \row}}";

rtfBeforeConversion correctly displays 3 columns with data in a RichTextBox.

rtfBrokenByConversion results in the 3rd column displaying no data (or data outside and to the right of it’s column depending on the DLL being used to interpret the RTF).

Stringwriter code

 using (StringWriter sw = new StringWriter())
            {
                GetRTF(sw);//inserts value of rtfBeforeConversion
                return sw.ToString();//ToString() creates rtfBrokenByConversion
            }

How can I correct this problem? (Note that I tried StringBuilder and had the same results)

  • 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-06-16T19:33:23+00:00Added an answer on June 16, 2026 at 7:33 pm

    Like other special characters \r, \n,, \t cannot be readily used inside of RTF. The character needs to be converted to it’s RTF equivalent. In this case I created an extension to clean the ill formatted text:

        public static string ConvertTabs(this string poorlyFormedRtf)
        {
            string unicodeTab = "\u0009";
            string result = poorlyFormedRtf.Replace(unicodeTab, "\\tab");
            return result;
        }
    

    Now everything looks great.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RichTextBox that I wish to fill with RTF text at design
I have an RTF file that I want to display inside a web page
We have rtf text stored in our database that looks like the following: {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0
I have a grid of data that I want to export to RTF, PDF
I am trying to generate RTF document. I have a RTF template that has
I'm parsing RTF 1.5+ files generated by Word 2003+ that may have content from
We have some code which produces an RTF document from a RTF template. It
I have a class that manages the creation of RTF documents and a method
I have an VB.Net/C# application that programmatically: Creates an RTF document Open it up
I have two or more rtf files in the form of StringWriter. How can

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.