Highlighted

Failure to recognize ’

New Here ,
Jan 11, 2019

Copy link to clipboard

Copied

I have extensive records containing dialog edited using CKEditor. It translates father's to father’s and this is how it is stored in the table.

I am pulling the records to make a web page - hundreds of them at a time. I process several text fields (nsvarchar) such as:

<cfset a = '<blockquote class="dkpurplefont"><i>Notes for birth: </i>' & #GetData.BirthNotes# & '</blockquote>'>

<cffile action="append" file="#fname#" output="#a#" addnewline="yes">

I was using <cfset a = '<blockquote class="dkpurplefont"><i>Notes for birth: </i> #GetData.BirthNotes#</blockquote>'> which should work. I switched it thinking I might solve the issue.

60% of the time I will see "father's" on the completed web page. 40% of the time I see "father?s"

I infer that the engine is choking on the &rsquo; as it processes #GetData.BirthNotes#  and I'm guessing it is a speed issue - it is being processed faster that it can interpret. I can't find a way to correct it because, by the time I have access to the data, the errant ? has already been inserted (along with other ? that should be there).

Suggestions?

Views

135

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Failure to recognize ’

New Here ,
Jan 11, 2019

Copy link to clipboard

Copied

I have extensive records containing dialog edited using CKEditor. It translates father's to father&rsquo;s and this is how it is stored in the table.

I am pulling the records to make a web page - hundreds of them at a time. I process several text fields (nsvarchar) such as:

<cfset a = '<blockquote class="dkpurplefont"><i>Notes for birth: </i>' & #GetData.BirthNotes# & '</blockquote>'>

<cffile action="append" file="#fname#" output="#a#" addnewline="yes">

I was using <cfset a = '<blockquote class="dkpurplefont"><i>Notes for birth: </i> #GetData.BirthNotes#</blockquote>'> which should work. I switched it thinking I might solve the issue.

60% of the time I will see "father's" on the completed web page. 40% of the time I see "father?s"

I infer that the engine is choking on the &rsquo; as it processes #GetData.BirthNotes#  and I'm guessing it is a speed issue - it is being processed faster that it can interpret. I can't find a way to correct it because, by the time I have access to the data, the errant ? has already been inserted (along with other ? that should be there).

Suggestions?

Views

136

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 11, 2019 0
Adobe Community Professional ,
Jan 13, 2019

Copy link to clipboard

Copied

Just before appending to file, apply:

<cfset a=replaceNoCase(a, "&rsquo;", "'", "all")>

<cfset a=replaceNoCase(a, "&lsquo;", "'", "all")>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 13, 2019 0
New Here ,
Jan 13, 2019

Copy link to clipboard

Copied

Thanks. Tried that. It seems that the erroneous ? (i.e., fails to

recognize ’) is inserted as a is first set. By the time I can

address the value of a it's too late.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 13, 2019 0
Adobe Community Professional ,
Jan 13, 2019

Copy link to clipboard

Copied

You could do something like

<cfset a=REReplaceNoCase("<blockquote class=""dkpurplefont""><i>Notes for birth: </i>#GetData.BirthNotes#</blockquote>", "&lsquo;|&rsquo;",  "'", "all")>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 13, 2019 0
New Here ,
Jan 14, 2019

Copy link to clipboard

Copied

I'll try that but it will be a couple of days.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 14, 2019 0
LEGEND ,
Jan 14, 2019

Copy link to clipboard

Copied

If you use canonicalize() prior to inserting the data into the database or adding it to a file, this will remove all HTML entities and set them back to their original value (ie, "&rsquo;" will be an apostrophe.)  Be sure to set both flags to "false", otherwise multiple encoded or nested encoded strings will trigger an error.

HTH,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 14, 2019 0