Chris
Chris

Reputation: 13

Character Truncation Issue

We are using the tag cfsavecontent then publishing to a pdf file. Certain characters seem to truncate the text after those characters.

These are the characters we have seen so far that cause the truncation of text

= > < 1

We have tried using this expression

REReplace(data,'<[^>]*>','','all')

<cfsavecontent variable="Abstract">



</cfsavecontent>

Upvotes: 1

Views: 81

Answers (1)

Alex
Alex

Reputation: 7833

Use mimetype="text/plain" with your cfdocument to preserve text. cfdocument defaults to text/html (HTML), which is the reason why characters like < and > mess with your content.

Alternatively you can encode your content for HTML. There's htmlEditFormat (CF9-) and encodeForHtml (CF10+) to do so, e.g. <cfset Abstract = htmlEditFormat(Abstract)>.

Upvotes: 1

Related Questions