Search

After having some problems with an XML Importer, I narrowed it down to emoji in the XML source. When I try manually saving an entry with an emoji character in a text field, I get an error like :

‘Body’ contains invalid XML. The following error was returned: loadXML(): Char 0xD83D out of allowed range in Entity, line: 1

So, does Symphony just not support emoji?

Do you mean saving the emoji icon itself in a text field or a text representation of that emoji?

The field will be formatted so I'm pretty sure any icons will be invalid but a HTML entity code may work though. Eg.

😊

You may need to wrap it in CDATA tags in the XSL templates to get it to display properly on output though:

<![CDATA[&#128522;]]>

If you're pulling in from a remote data feed then you may need to process that part to convert from UTF to a HTML character entity.

I think @ijy explains what needs to be done quite clearly, I just wanted to add that it's worth keeping in mind that XSLT is quite a strict language.

Even named HTML characters won't render without error, i.e. &nbsp; needs to be &#160;.

For your icon, you'd need &#55357;. link

If you don't have control over the source that's a slightly different issue of course and may involve some translation!

Thanks @nathanhornby – I had to put this investigation on hold.

I believed that the issue was with an XML Importer that is aggregating tweets (and Twitter user data) via the Twitter extension. One Importer in particular will always timeout and recent data is missing, so i suspected that it was failing when encountering raw emoji characters. When I took a look at MySQL however, I can see that at least some emoji are imported successfully and even displayed correctly in the Symphony backend. Attempting to enter and save a raw emoji character via the Symphony backend seems to be a separate issue. So I'm not really sure what's going on.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details