CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • XML error while trying to parse accented strings
Pages: [1]

Author Topic: XML error while trying to parse accented strings  (Read 1437 times)

Edsel Roque Lopez

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: 7.10
  • MySQL version: 5
  • PHP version: 5.3.6
XML error while trying to parse accented strings
September 04, 2014, 07:17:09 am
Hi,

I have a site with CiviCRM 4.4.6 and french localisation installed. When I try to click on the link to load RSS feeds for current and future public events, this is the output I get:

This page contains the following errors:

error on line 11 at column 62: Entity 'Atilde' not defined
error on line 11 at column 62: Encoding error

Looks like the XML is terminating at

<description>
Dans le cadre de la Journ&Atilde;&copy;e des Franco-Ontariens et des Franco-Ontariennes, le Club canadien de Toronto &Atilde;&nbsp; le plaisir de vous  inviter &Atilde;&nbsp;  son premier d&Atilde;&copy;jeuner de la saison 2014-2015, le jeudi 25 septembre 2014
&lt;p&gt;Mme Gouin nous entretiendra de l&acirc;

Any suggestions? I'm wondering if there is anything else needed to be done to ensure that certain fields containing accented values are encoded properly.

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: XML error while trying to parse accented strings
September 04, 2014, 10:52:57 am
Hi,

Just to confirm, is the error from your browser trying to display the RSS feed? Or is it from a CMS trying to parse it?

If it's from your browser, which browser is it?

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Edsel Roque Lopez

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: 7.10
  • MySQL version: 5
  • PHP version: 5.3.6
Re: XML error while trying to parse accented strings
September 05, 2014, 12:19:53 am
Hi Mathieu,

The error is from my browser trying to display the RSS feed. I am using Chrome 32.0.1700.107 on an Ubuntu 12.04 LTS OS. I checked on Firefox, and although I don't see the error there, I don't see the feed either. Here is a link to the site which has the error.  http://clubcanadien.ca/civicrm/event/ical?reset=1&list=1&rss=1

Thanks for the reply,
Edsel

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: XML error while trying to parse accented strings
September 05, 2014, 06:36:26 am
Hi Edsel,

I can confirm the bug: I created an event with the character "é" in it, and CiviCRM encoded it in the RSS feed as "&Atilde;&copy;", which seems to point to a double-encoding bug.

Example:
http://civi45.bidon.ca/civicrm/event/ical?reset=1&list=1&rss=1

The bug seems to be in templates/CRM/Core/Calendar/Rss.tpl, where it "escapes" special characters, and it assumes that accents are special characters.

I have to run out, but I will try to look back at it later today. Thanks for reporting the issue!

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: XML error while trying to parse accented strings
September 05, 2014, 03:53:36 pm
I reported the bug to the civicrm issue tracker:
https://issues.civicrm.org/jira/browse/CRM-15246

and proposed a patch for the upcoming CiviCRM 4.5:
https://github.com/civicrm/civicrm-core/pull/4061

If you would like to apply the patch locally in the mean time, you can see the changes to do in the file "templates/CRM/Core/Calendar/Rss.tpl":
https://github.com/civicrm/civicrm-core/pull/4061/files
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Edsel Roque Lopez

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: 7.10
  • MySQL version: 5
  • PHP version: 5.3.6
Re: XML error while trying to parse accented strings
September 07, 2014, 11:35:19 pm
Thanks so much for the patch!

It fixed the issue I was having  :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • XML error while trying to parse accented strings

This forum was archived on 2017-11-26.