ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Single quotes in title field are converted to curly quotes

January 20, 2011 10:09am

Subscribe [5]
  • #1 / Jan 20, 2011 10:09am

    Leon Dijk

    131 posts

    Hi,

    When I use an entry title such as

    This shouldn't be a qurly quote

    and use the exp:channel:entries tag to output the title, the single quote is being converted to a curly quote.

    I’ve searched and found some related posts, but couldn’t find a clear answer. Also, I think most of those problems were with EE1.

    When I look the entry up in the database, it shows a normal single quote. So the conversion happens on output.

    My doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html >

    Charset:

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    but I’m quite positive that’s not the problem, as my pages show normal quotes when I enter them directly in a template like this for example:

    <h1>This shouldn't be a qurly quote</h1>

    Any ideas? I’m using EE 2.1.3, although this also happened with 2.1.1 I think.

  • #2 / Jan 20, 2011 4:30pm

    Ingmar

    29245 posts

    When I look the entry up in the database, it shows a normal single quote. So the conversion happens on output.

    Yes, it’s the typography parser. For a custom field it’s usually sufficient to choose “Formatting: None” instead of XHTML.

  • #3 / Jan 20, 2011 4:35pm

    Leon Dijk

    131 posts

    I understand, but it happens on the default Title field, for which I can’t set any formatting as far as I know?

  • #4 / Jan 21, 2011 9:44am

    Ingmar

    29245 posts

    I am looking into this. Thank you for your patience.

  • #5 / Jan 21, 2011 11:15am

    Ingmar

    29245 posts

    I am afraid that you’d need to use a plugin around the title field in the template to change it; you can’t change it with a setting in EE. Alternatively you could use a secondary title field which, as a regular custom field, can be formatted as desired.

    Sorry I have no better news. Feel free to make a Feature Request, too.

  • #6 / Jan 21, 2011 2:23pm

    Leon Dijk

    131 posts

    Hi Ingmar,

    Thanks for taking the time to look into this!

    It strikes me that this is standard behavior. If I enter a quote and it gets stored as a quote in the database, I don’t expect it to be converted into a curly quote by the exp:channel:entries tag.

    Before I started this thread, I spent hours looking for a reason why it converted my quotes..server settings, EE settings etc. Sure, I could create a secondary title field or use a find and replace plugin like you suggested, but it is what it is: a workaround for something that shouldn’t happen in the first place. I am currently using the find/replace method, but since I use the title field for quite a few purposes (h1 tag, breadcrumbs, social network api’s etc), it’s not ideal.

    Thanks again for your help and suggestions, I’m going to submit a feature request!

    Cheers,
    Leon

  • #7 / Jan 22, 2011 3:08pm

    Greg Salt

    3988 posts

    Hi Leon,

    The title variable data should properly convert single quotes into the HTML code:

    Is this not happening for you? This behaviour was changed some time ago in the EE 1.x branch in order to make sure that titles were valid HTML. Up until then titles had to be wrapped a typography plugin.

    Cheers

    Greg

  • #8 / Jan 22, 2011 7:49pm

    Leon Dijk

    131 posts

    Hi Greg,

    Yes, that is what my installation of EE does, it converts a single quotation mark into a “right single quotation mark”:

    ..which is not the same as a single quote. When I enter a single quote in the title field, it should stay a normal single quote and shouldn’t be converted into a right single quotation mark. So, it should be this instead:

    '

    Also, when I copy/paste a right single quotation mark (not the HTML entity equivalent, but the actual character) into the title field and then display it on a page with the exp:channel:entries tag, it isn’t being converted into its HTML entity equivalent, which seems kind of strange as well.

    I hope this makes sense. To me, it looks like a bug. See http://www.ascii.cl/htmlcodes.htm for example for a list of ASCII characters, you’ll see that the single quote should be &#39; and the right single quotation mark should be &#8217;

    Cheers,
    Leon

  • #9 / Jan 24, 2011 2:25am

    John Henry Donovan

    12339 posts

    Leon,

    For now please go ahead and make a Feature Request as suggested.
    These requests are read by our devs all the time

  • #10 / Jan 24, 2011 4:17pm

    Leon Dijk

    131 posts

  • #11 / Jan 24, 2011 4:21pm

    Ingmar

    29245 posts

    Glad to see that cleared it up. Please don’t hesitat to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases