You are here:  » import characters

Support Forum



import characters

Submitted by don_load on Sat, 2010-12-04 13:41 in

Hi David,

On some of my feeds the merchants use html entities and special characters. I've tried adding a HTML entity decode filter and all that happens is I get left with the word 'amp' instead of &. All that seems to be happening is the characters from '& a m p ;' are bring stripped away leaving me with 'amp'. Also, any special characters like those used for > or | just disappear.

I've got an extra field used for storing the original category name before any filters and category mappings happen. Applying the decode filter to that field works fine. Do you know what might be causing the filter to not work when used on the main category field?

J

Submitted by support on Sat, 2010-12-04 14:15

Hi,

What sometimes happens is that the data is "double" entity encoded. Try first adding a Search and Replace filter for & a m p ; with &, and then follow that with HTML Entity Decode - I think that should do the trick...

Cheers,
David.
--
PriceTapestry.com

Submitted by don_load on Sat, 2010-12-04 15:31

that has no affect, still coming up with amp

regards,
Jay

Submitted by don_load on Sat, 2010-12-04 16:28

tracked down the problem.

Before the filters are applied the script executes tapestry_normalise($importRecord["category"]) on the category. Removing that then allows the filters to work perfectly.

Are there any downside to permanently removing the tapestry_normalise function from that line?

regards,
Jay

Submitted by support on Sat, 2010-12-04 16:29

Hi Jay,

Was just about to get back to you about the normalisation! It does remove characters that could break clean URLs e.g. /caegory/Category-Name/ so what you could do is instead of removing the tapestry_normalise() call altogether, move that line to after where user filters have been applied, and then either HTML Entity Decode or Search and Replace should work as expected...

Cheers,
David.
--
PriceTapestry.com

Submitted by don_load on Sat, 2010-12-04 16:52

thats worked quite nicely, thanks!

regards,
Jay

Submitted by crounauer on Wed, 2011-10-12 21:59

Hi David,

Sorry, I am still having issues with B&Q. Merchant Logos do not upload properly and merchant products don't seem to display properly => http://www.example.co.uk/appliances/cooking/merchant/b-&-q/ with the changes I made.

Thanks,
Simon

Submitted by support on Thu, 2011-10-13 07:11

Hi Simon,

Ah yes - this was what I thought (you may have just seen my reply in other thread). The & character has so many special meanings within URLs and filenames what I normally suggest is to use a Search and Replace filter against the Merchant Name field to replace

" & "

with

" and "

(without the quotes)

An alternative would be to hold a separate display version of the merchant name, let me know if you'd like to investigate this approach...

Cheers,
David.
--
PriceTapestry.com