2010-04-16 43 views
1

我正在嘗試使用utf-8編碼爲要發送到Google Base的數據創建自動Feed生成。 但是,當連字符被發現告訴我相關屬性(標題,描述,產品類型)中存在編碼錯誤時,我會收到錯誤。我目前正在使用:Google Base RSS Feed中的連字符編碼(減號)

− 

,但我自己也嘗試:

− 

這兩者都不工作過。 我使用下面的聲明在文檔的頂部:

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

好提供進一步的情況下,以這個數據是從存儲在MySQL數據庫中UTF-8編碼的數據我們的網站的產品信息拉。數據將進入RSS 2.0 Feed,使用一些標準的RSS屬性以及一些自定義的Google屬性。只要鏈接字段以外的任何字段都有連字符,問題就會出現。所以它出現在標題和說明字段以及自定義的product_type字段中。以下是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> 

回答

0

你說的是使用連字符,但你試圖插入的字符是數學減號。你有沒有用實際連字符試過?而不是HTML實體;只是字符,-

+0

對不起,澄清我也試過­和–是的,原始數據只有字符和沒有html實體,這就是問題的出發點。數據也來自UTF-8來源。 – pmells 2010-04-20 09:28:14

+0

是的,如果減號不起作用,我會期望一個軟連字符或一個連字符引起問題。但是,您是否嘗試用簡單的舊破折號(即大多數英語鍵盤上的零右側的字符)替換那裏的所有內容? – 2010-04-20 11:13:38

+0

是的,這就是它最初的樣子,但我嘗試替換顯示的字符以及無論如何只是爲了看到,我仍然有同樣的問題。 – pmells 2010-04-21 08:29:18