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

Problems with Replace

Explorer ,
Jun 12, 2008 Jun 12, 2008
I am using a cfc to create an XML page that Ajax can use to display our products. Some of the product names contain special characters such as ®, which XML can't display. How do I strip those characters out so that the products will display?

I have tried this: <cfset products_name = Replace(products_name, "®", " ", "ALL")>. But this is not working as expected. Any suggestions?
602
Translate
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

correct answers 1 Correct answer

Explorer , Jun 12, 2008 Jun 12, 2008
Ok, I figured it out. It wasn't the Replace expression, but it was the variable name that I used, which was the same name as the query column name.. Thanks for helping!
Translate
LEGEND ,
Jun 12, 2008 Jun 12, 2008
use regular expressions to restrict the content to just the characters you want.
Translate
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 ,
Jun 12, 2008 Jun 12, 2008
EnergyFed wrote:
> I am using a cfc to create an XML page that Ajax can use to display our
> products. Some of the product names contain special characters such as ?,
> which XML can't display. How do I strip those characters out so that the
> products will display?
>
> I have tried this: <cfset products_name = Replace(products_name, "?", " ",
> "ALL")>. But this is not working as expected. Any suggestions?
>

Have you tried the XMLformat() function?
Translate
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
Explorer ,
Jun 12, 2008 Jun 12, 2008
Yeah, I tried the XMLformat() function and it didn't work.

Dan, how would you use a regular expression to restrict the content? I've looked at the live docs, and I can't see what I am doing wrong..
Translate
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
Explorer ,
Jun 12, 2008 Jun 12, 2008
LATEST
Ok, I figured it out. It wasn't the Replace expression, but it was the variable name that I used, which was the same name as the query column name.. Thanks for helping!
Translate
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