Skip to main content
sherrys57577141
Participant
January 11, 2019
Question

Failure to recognize ’

  • January 11, 2019
  • 1 reply
  • 394 views

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?

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    January 13, 2019

    Just before appending to file, apply:

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

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

    sherrys57577141
    Participant
    January 13, 2019

    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.

    BKBK
    Community Expert
    Community Expert
    January 13, 2019

    You could do something like

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