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.

charsets, phpMyAdmin, entities

July 09, 2010 6:54pm

Subscribe [5]
  • #1 / Jul 09, 2010 6:54pm

    earthisland

    46 posts

    Hi,
    I’m revisiting a problem I eluded rather than solved awhile back (old thread) and will be moving my 1.6x ‘site from one machine at my host to another. Previously I had trouble with a db restore that turned high-ascii and html entities to nonsense; I’ve read this thread and this one and others about similar adventures, and am hoping that there’s a consolidated body of knowledge on the best way to avoid pitfalls. Such as…

    I did a test dump from phpMyAdmin and found, for instance, that the acute ‘e’ in the word ‘Cafe’ is turned to a tilde capped ‘A’ and a copyright symbol (viewed in Notepad++). Viewing the data in phpMyAdmin’s browse function yields the same result, but viewing it in the source Web site shows correctly, and in the EE edit dialogue it shows as é (

    é

    ), as it was entered.

    Is it phpMyAdmin’s export dump that’s altering it? Are there settings that would yield a cleaner dump? Any help or pointers would be appreciated. Thanks,
    Matthew

  • #2 / Jul 09, 2010 7:31pm

    Brandon Jones

    5500 posts

    Hi Matthew,

    What collation are your db and tables? Do you have a link to the site where the character appears correctly?

  • #3 / Jul 09, 2010 7:48pm

    earthisland

    46 posts

    Hi,
    Thanks for responding. The default install tables’ collation on the db is latin1_swedish_ci, though module tables installed thereafter are utf8_general_ci. The phpMyAdmin ‘MySQL connection collation’ is set to utf8_general_ci as well. The EE install has utf 8 as the charset.

    The ‘site is up and running fine for a couple of years, with the entities displaying correctly; the scrap of the dump I was looking at is from the entry on this page, a source view of which shows the é in Café entity spelled out as

    é

    so the db and the application as it sits seem to understand one another.

    I guess I’m hoping there’s a way to get the dump to behave? Thanks again,
    Matthew

  • #4 / Jul 09, 2010 8:39pm

    Brandon Jones

    5500 posts

    What concerns me is that you’re seeing incorrect encoding in phpMyAdmin’s Browse view. In my experience those characters should appear correctly. But, I’ve pretty much always used UTF-8.

    I’d be curious to see what happens if you change a problematic table to utf8_general_ci (backing up everything first, of course) and then see if the export goes any better.

  • #5 / Jul 09, 2010 9:11pm

    earthisland

    46 posts

    Hi,
    Yes, I’ll build a test setup again and check out what happens. What I worry though, is that the act of backing up is where the problem gets introduced. The phpMyAdmin fora rather predictably say that it can’t be where the fault is. I will try to get a backup from the command line and compare the two…
    Thanks,
    Matthew

  • #6 / Jul 10, 2010 1:58pm

    Greg Salt

    3988 posts

    Hi Matthew,

    Okay. Let us know what the outcome of your test is.

    Cheers

    Greg

  • #7 / Jul 13, 2010 7:09pm

    earthisland

    46 posts

    Hi,
    I hit a non-EE related snag building my test setup, but ‘till I get it done I wanted to update that at least some errors in the db view seem to be replacements for pasted characters rather than for html entities. That is, they present as ‘…’ in the db view, but on the Web site show up as ‘…’ in the browser and the source.

    And to clarify something I was mistaken about before, entities that were entered as

    or whatever show up in the phpMyAdmin browser the way they should, as Brandon expected; they just get exported to the .sql file as nonsense. Thanks again,
    Matthew

  • #8 / Jul 14, 2010 5:07pm

    Ingmar

    29245 posts

    That is, they present as ‘…’ in the db view, but on the Web site show up as ‘…’ in the browser and the source.

    That db view, is that using EE? It looks like you are seeing utf-8 encoded characters as Latin-1. That said, if it works on your site, don’t worry about it.

  • #9 / Jul 14, 2010 6:15pm

    earthisland

    46 posts

    In the above post I was referring to the view in the browse tab of phpMyAdmin. So far, the characters all look fine in the ‘site. The problem is that I need to move my ‘site off of a failing server to a new one at my host, and I’m hoping for a recipe that will not put ‘…’  in place of the ‘…’. Commonest is when a user has pasted a right single quote from a word processor; in the dump it shows as nonsense. Thanks.

  • #10 / Jul 14, 2010 7:53pm

    earthisland

    46 posts

    Hi,
    An update; things are looking fine in my test system. I’m struggling with an extension incompatibility, but I guess the nonsense isn’t as much of a problem as I feared. Thanks all for the reassurance,
    Matthew

  • #11 / Jul 15, 2010 6:52am

    John Henry Donovan

    12339 posts

    Thanks for the update Matthew. I’m gonna close this one out.Feel free to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases