Google Base RSS feed 中的连字符编码(减号)

发布于 2024-08-29 07:48:11 字数 2270 浏览 7 评论 0原文

我正在尝试创建自动提要生成,以便使用 utf-8 编码将数据发送到 Google Base。 但是,每当发现连字符告诉我相关属性(标题、描述、产品类型)中存在编码错误时,我就会收到错误。我目前正在使用:

−

但我也尝试过:

−

两者都不起作用。 我在文档顶部使用以下声明:

<?xml version="1.0" encoding="utf-8"?>

好的,为了提供更多上下文,数据是从我们网站的产品信息中提取的,该产品信息以 utf-8 编码数据存储在 MYSQL 数据库中。数据将使用一些标准 RSS 属性以及一些自定义的 Google 属性进入 RSS 2.0 提要。每当除链接字段之外的任何字段中存在连字符时,就会出现问题。因此它出现在标题和描述字段以及自定义产品类型字段中。以下是 Google Base(商家中心)抛出错误的字段示例。无论有或没有其他实体,它都会引发相同的错误,并且只有在删除连字符时才会停止反对。

    <description>&lt;p&gt;Your sports floor is designed primarily for sports use. Thou many facilities have to be used for other activities including things like; assemblies careers fairs drama parties and social events bring and buy sales exhibitions etc.&lt;/p&gt;

&lt;p&gt;Solid hardwood sports floors are designated as &quot;area elastic floors&quot; to provide the spring resilience and shock absorbing qualities needed for sports and dance use to minimise injury. If the floor is too hard the athlete and user will be exposed to early fatigue and aching joints through to injury such as sprains joint and shin bone damage.&lt;/p&gt;

&lt;p&gt;If too soft then ball bounce and running characteristics are compromised.
In the UK hardwood sports floors are governed by a number of recognised standards&lt;/p&gt;

&lt;p&gt;All sports floors must conform to BS7044 Part 4 - this is the minimum Sport England requirement with which your floor msut comply if it is part of a Sport England sponsored project.&lt;/p&gt;

&lt;p&gt;A higher more demanding standard for better quality sports and dance flooring is DIN 18032 Part 2&lt;/p&gt;

&lt;p&gt;The newest - and the best - standard is the European Standard CEN 217. This standard has brought together all the best eprformance criteria from a number of current standards in the EU including BS and DIN.&lt;/p&gt;

&lt;p&gt;All Junckers systems fully comply with one or more of these standards. They ALL comply with the minimum Sport England requirement of BS7044 Part 4 compliance.&lt;/p&gt;</description>

I am trying to create an automatic feed generation for data to be sent to Google Base using utf-8 encoding.
However I am getting errors whenever hyphens are found telling me that there is an encoding error in the relevant attribute (title, description, product_type). I am currently using:

&minus;

but I have also tried:

&#8722;

neither of which have worked.
I am using the following declaration at the top of the document:

<?xml version="1.0" encoding="utf-8"?>

Ok to give further context to this the data is being pulled from our site's product information stored as utf-8 encoded data in a MYSQL database. The data is going into an RSS 2.0 feed, using the some standard RSS attributes as well as some custom defined Google attributes. The problem comes up whenever there is a hyphen in any field except the link field. So it is appearing in the title and description fields as well as the custom product_type field. Below is an example of a field that Google Base (merchant centre) throws an error over. It throws the same error with or without the other entities and only stops objecting when hyphens are removed.

    <description><p>Your sports floor is designed primarily for sports use. Thou many facilities have to be used for other activities including things like; assemblies careers fairs drama parties and social events bring and buy sales exhibitions etc.</p>

<p>Solid hardwood sports floors are designated as "area elastic floors" to provide the spring resilience and shock absorbing qualities needed for sports and dance use to minimise injury. If the floor is too hard the athlete and user will be exposed to early fatigue and aching joints through to injury such as sprains joint and shin bone damage.</p>

<p>If too soft then ball bounce and running characteristics are compromised.
In the UK hardwood sports floors are governed by a number of recognised standards</p>

<p>All sports floors must conform to BS7044 Part 4 - this is the minimum Sport England requirement with which your floor msut comply if it is part of a Sport England sponsored project.</p>

<p>A higher more demanding standard for better quality sports and dance flooring is DIN 18032 Part 2</p>

<p>The newest - and the best - standard is the European Standard CEN 217. This standard has brought together all the best eprformance criteria from a number of current standards in the EU including BS and DIN.</p>

<p>All Junckers systems fully comply with one or more of these standards. They ALL comply with the minimum Sport England requirement of BS7044 Part 4 compliance.</p></description>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2024-09-05 07:48:11

您谈论使用连字符,但您尝试插入的字符是数学减号。您是否尝试过使用实际的连字符?也不是 HTML 实体;只是字符,-

You talk about using hyphens, but the character you're trying to insert is the mathematical minus sign. Have you tried it with an actual hyphen? And not a HTML entity, either; just the character, -.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文