• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Failure to recognize ’

New Here ,
Jan 11, 2019 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

249

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
community guidelines
Community Expert ,
Jan 13, 2019 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")>

Votes

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
community guidelines
New Here ,
Jan 13, 2019 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.

Votes

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
community guidelines
Community Expert ,
Jan 13, 2019 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")>

Votes

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
community guidelines
New Here ,
Jan 14, 2019 Jan 14, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
LEGEND ,
Jan 14, 2019 Jan 14, 2019

Copy link to clipboard

Copied

LATEST

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,

^ _ ^

Votes

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
community guidelines
Resources
Documentation