You are here:  » Some characters appearing as numbers

Support Forum



Some characters appearing as numbers

Submitted by Harvey on Fri, 2007-02-23 19:47 in

Hi David,

Not sure if this has been covered before, but for a couple of my merchants some characters appear as numbers - an apostrophe for example as 8217.

An example:

"Is it a bird...Is it a plane.... No it8217s a 8230UFOYes, it8217s true, the X UFO has landed!8230 This unique new radio controlled X UFO flying saucer is probably the most original flying machine ever seen in the UK!8230..."

Any ideas?

Submitted by support on Fri, 2007-02-23 19:54

Hi Harvey,

What's happened here is that the characters have been encoded into HTML entities; for example an apostrophe is:

Now, during import, the &, # and ; characters are stripped, leaving you with 8217. If it is only affecting description fields, it is safe to deal with this by allowing #, & and ; into the description. In includes/admin.php these characters are stripped by the following code on line 163:

$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],",'\'\.%!");

change this as follows:

$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],",'\'\.%!&#;");

The entities should then be displayed correctly (after re-importing the feed of course)...

Hope this helps,
Cheers,
David.

Submitted by Harvey on Wed, 2007-02-28 14:03

Hi David,

Thanks for the reply.

I'm now having problems with titles - they seem to have some things ommitted - eg:

- Cranium KeychainsCranium
- 20QNew Version

I think this is because PT is getting rid of a ":" or a "-", but not sure what happened to the spaces.

Any ideas? Thanks

Submitted by Harvey on Wed, 2007-02-28 14:09

Hi David,

Please ignore that last post as I've worked out it was just a problem with a particular merchant.

Cheers

Submitted by stevlam on Tue, 2007-03-06 17:11

Hi,

I have problems with titles where the title containing & but the & and ; are stripped. For example, the 'Getting Personal' feed from affiliate window has 'Love Cricket DVD amp Greeting Card in one' once imported (in the feed is is Love Cricket DVD & Greeting Card in one). That is one example, there are others such as £ and other strange characters which previously I thought was a character set issue, but they are there in the feeds themselves.

How can this be solved? Can we do the same on the title as the description? I don't really want to setup individual filters as I have hundreds of feeds. Is it possible to setup a global filter.

cheers

Submitted by support on Tue, 2007-03-06 17:31

Hi,

Yes - you can make exactly the same modification to the title field. In this case, to permit HTML entities in the product name, find the following code on line 157 of includes/admin.php:

    $record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]]);

..and change this as follows:

    $record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]],"&;");

This will permit the & and ; characters leaving the entities intact.

Cheers,
David.

Submitted by stevlam on Wed, 2007-03-07 07:11

Hi David,

Thanks. Could this potentially cause any problems? I was just wondering why it was not built into the script already?

cheers

Steve

Submitted by support on Wed, 2007-03-07 07:15

Hi Steve,

It shouldn't cause any problems, but by default i've given the script a very strict import "pruning" policy which guarantees that there won't be any problems down the line. Once you start allowing special characters into the title you can just never be 100% sure that browsers, search engine spiders and search engines themselves are going to handle them correctly, so I err on the side of safety!

Cheers,
David.