We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10076
    • 1,024 Posts
    Hi I am having a problem with a site where the host restored a (to) old backup. And now the characters are not showing correctly. How do I troubleshoot this? check: http://www.pianoquartet.nl/index.php?id=2&compchar=F
    Sorry about the weird URL but thats another issue. I have a backup myself from a date where this character issue was not there however the site owner added new data before noticing the problems. The host is crap but a friend of the site owner, just my luck.
      • 10076
      • 1,024 Posts
      I will add that to my template. Unclear to me however is the three p[laces where one can/should set te character encoding. In Modx configuration, in mysql and in the template. Should they all be the same?

      Something like this in the template:
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      and then utf-8 for mysql and for modx config?
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: Frank at Mar 22, 2008, 04:13 AM

        I will add that to my template. Unclear to me however is the three p[laces where one can/should set te character encoding. In Modx configuration, in mysql and in the template. Should they all be the same?
        Well, no, but they should all be compatible. The database character sets are different than HTML character encoding and unfortunately, it’s not a simple subject. The short answer is UTF-8 is correct for a character encoding in HTML land, but utf8 (no dash) is the database character set that is compatible; for ISO-8859-1 HTML encoding it’s latin1 database charset, etc.

        Too start learning more about the complex subject of i18n, start here. The official listing of IANA-registered character sets might help you more easily identify the corresponding MySQL charset for the character encoding you intend to use when serving your pages.
          • 10076
          • 1,024 Posts
          Update,

          as the data is inserted through php forms that run outside modx, i think it needed following:
          mysql_query(”SET character_set_client = utf8;”);
          mysql_query(”SET character_set_results = utf8;”);

          in my config.php file. Anyway I used this and after running the correct queries, all is okay.

          Only thing remaining is to rebuild them scripts to integrate the with eform.


          [s]Hi,

          I have not been able to do above suggestions up till today.
          my config:
          - System config character encoding utf-8
          -template encoding : <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          -database: latin1_swedish_ci

          I also tried running the following from phpmyadmin. Queries were succesfull, I mean no MySQL syntax errors. But MySQL responds:
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'ü', 'ü');# MySQL returned an empty result set (i.e. zero rows).
          On all querys shown below. And the characters on the page as well as in the database remain the way they are. What am i doing wrong here?

          UPDATE `quartets` SET Composer=REPLACE(Composer,  'ç',  'ç');
          UPDATE `quartets` SET Composer=REPLACE(Composer,  'ü',  'ü');
          UPDATE `quartets` SET Composer=REPLACE(Composer,  'ö',  'ö');
          UPDATE `quartets` SET Composer=REPLACE(Composer,  'ä',  'Ä');
          UPDATE `quartets` SET Composer=REPLACE(Composer,  'Ü',  'Ü');
          
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'ç', 'ç');
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'ü', 'ü');
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'ö', 'ö');
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'ä', 'Ä');
          UPDATE `quartets` SET Opus=REPLACE(Opus, 'Ü', 'Ü');
          
          UPDATE `quartets` SET Publisher=REPLACE(Publisher, 'ç', 'ç');
          UPDATE `quartets` SET Publisher=REPLACE(Publisher, 'ü', 'ü');
          UPDATE `quartets` SET Publisher=REPLACE(Publisher, 'ö', 'ö');
          UPDATE `quartets` SET Publisher=REPLACE(Publisher, 'ä', 'Ä');
          UPDATE `quartets` SET Publisher=REPLACE(Publisher, 'Ü', 'Ü');
          
          UPDATE `quartets` SET Oddities=REPLACE(Oddities, 'ç', 'ç');
          UPDATE `quartets` SET Oddities=REPLACE(Oddities, 'ü', 'ü');
          UPDATE `quartets` SET Oddities=REPLACE(Oddities, 'ö', 'ö');
          UPDATE `quartets` SET Oddities=REPLACE(Oddities, 'ä', 'Ä');
          UPDATE `quartets` SET Oddities=REPLACE(Oddities, 'Ü', 'Ü');
          
          UPDATE `publisher` SET name=REPLACE(name, 'ç', 'ç');
          UPDATE `publisher` SET name=REPLACE(name, 'ü', 'ü');
          UPDATE `publisher` SET name=REPLACE(name, 'ö', 'ö');
          UPDATE `publisher` SET name=REPLACE(name, 'ä', 'Ä');
          UPDATE `publisher` SET name=REPLACE(name, 'Ü', 'Ü');



          Update, I have been able to change a character with this query:
          UPDATE `quartets` SET Composer=REPLACE(Composer,   'é', 'é');

          Unfortunatly the é character was now displayed as a square Dani�l-Lesur See: Lesur. This is driving me crazy huh, cause I can change the character through a form (a bit like eform2db). And it will then show correctly?[/s]