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.

Problems with database import

March 20, 2008 11:20am

Subscribe [2]
  • #1 / Mar 20, 2008 11:20am

    Ben Johnson

    29 posts

    So, I’m not sure that this is strictly an Expression Engine difficulty, but I’m not sure and I didn’t know where else to go…

    I’ve been importing and exporting an Expression Engine database back and forwards from my development machine to the live server. What I’ve started to run into is that on import, smart quotes begin to display as: “, and â€. When I look at the development site, they show as smart quotes on the page, but in the database (through phpmyadmin) they display as â€. So, it looks like it’s storing them in the database but they’re displaying properly, while on the live server they are getting stored the same way in the database, but they aren’t getting parsed into smart quotes.

    I checked my collation and database settings and it looks like they’re the same on both sides. The import looks correct too: I’m going from latin1 to latin1.

    What I want to know is:

    1) I have I managed to corrupt the database? Should smartquotes be stored as †in the db?
    2) If it’s acceptable that they’re getting stored that way, what are some investigatory routes to try to figure out why it’s displaying differently?

    Any ideas?

    Ben Johnson.

  • #2 / Mar 20, 2008 12:31pm

    Robin Sowell

    13255 posts

    The fact the collations and all match up suggest that it should be all the same.  And- what you see when you view the db may vary based on browser settings etc.  What I’d do?  Export as a text file one table from each install where you know you’ll run into the curly quotes.  Pop them open in a text editor- do they still differ?

  • #3 / Mar 20, 2008 4:45pm

    Ben Johnson

    29 posts

    Yep, tried that already. In Textmate it’s showing up with the †characters. I tried a find and replace but that REALLY messed it up.

  • #4 / Mar 20, 2008 4:53pm

    Lisa Wess

    20502 posts

    Have you tried a different charset when exporting? It sounds like the export itself is having the issue.  If you go and view it directly in the database, through PHPMyAdmin - are they the wrong characters tehre?

  • #5 / Mar 20, 2008 5:08pm

    Ben Johnson

    29 posts

    Yes, on the server that displays the characters properly in the browser, phpmyadmin shows the †characters in the weblog data table.

  • #6 / Mar 20, 2008 5:10pm

    Ben Johnson

    29 posts

    Ok, this is interesting. If I view the source of the page I see quotes but they’re not HTML entity quotes they show as actual smart quotes. If I copy one of the smart quotes into Textmate, I get â€.

    This might have to do with the Markdown plugin…

  • #7 / Mar 20, 2008 5:25pm

    Lisa Wess

    20502 posts

    If you use standard formatting for one post in your field, do you experience the same problem?

  • #8 / Mar 20, 2008 5:38pm

    Ben Johnson

    29 posts

    So, I managed to get rid of all the visible problems using find and replace. I’ve been using the standard formatting fields and then using {exp:markdown} tags. The strange thing is that markdown doesn’t seem to be converting the pain text ” into html smart quotes. I’m happy that I’ve been able to clean up the mess, but I sort of wonder why this isn’t working right.

    Thanks for all your help. It really made a big difference having someone to troubleshoot this with.

    Ben.

  • #9 / Mar 20, 2008 5:41pm

    Lisa Wess

    20502 posts

    Hi, Ben,  Have you considered using Markdown as the custom field formatting? That’s what I do, no need to have that processing in the template then.

    I’m not actually sure that would have resolved this, as we didn’t drill down to the cause.  But it is something to consider.  What do you think?

  • #10 / Mar 20, 2008 5:59pm

    Ben Johnson

    29 posts

    Ok, took the markdown tags out, set the fields to be markdown fields, and while everything looks good, it’s still not converting the quotes into entities. However, it IS processing things like headers…

  • #11 / Mar 20, 2008 6:07pm

    Ben Johnson

    29 posts

    Having smartypants installed would probably help…

    😉

  • #12 / Mar 20, 2008 7:04pm

    Lisa Wess

    20502 posts

    So are you all fixed up?

  • #13 / Mar 20, 2008 8:07pm

    Ben Johnson

    29 posts

    Yep, got it. I’m sort of happy I had the problem, or I wouldn’t have known about the state of quotation marks.

    Thanks again for all your help.

    Ben.

  • #14 / Mar 20, 2008 8:10pm

    Sue Crocker

    26054 posts

    Just closing the thread.

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

ExpressionEngine News!

#eecms, #events, #releases