0
votes

I have to make an rtf to html converter. I have an already coded application but it has some bugs.. Whenever i enter a bullet point it crashes

Original Rtf

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset2 Symbol;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\lang3081\f0\fs18 Paragraph writing is the foundation of all essay writing, whether the form is expository, persuasive, narrative, or creative. In order to write a \ul\b\i good paragraph\ulnone\b0\i0 . \par \lang1033 \par \pard{\pntext\f2\''B7\tab}{*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\''B7}}\fi-165\li165 Element 1\cf0\f1\fs24 \par }

It crashes because of the line

\pard{\pntext\f2\''B7\tab}{*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\''B7}}

If I remove this line the Rtf is converted to html successfully. I am new to Rtf syntax. So my question is...is this Rtf syntax correct in the first place?

1

1 Answers

2
votes

The RTF specification shows that \'' is not valid - \' should be followed by a hexadecimal value, but in your example it is followed by another apostrophe (and then by a hexadecimal value).