2

I have this xml file to parse:

 <?xml version="1.0" encoding="utf-8"?>
    <Exchange_Rates>
      <Actual_Rates>
        <Bank>
          <Name>АКРОПОЛЬ</Name>
          <Url>http://bank...</Url>
        </Bank>
      </Actual_Rates>
    </Exchange_Rates>

I parsed it in to a database, everything worked just fine, I could read and write the name of the bank with mysql database correctly in Russian (АКРОПОЛЬ). But the problem was in the phpMyAdmin, I couldn't edit database with phpMyAdmin because the name wasn't showed correctly.(ÐКРОПОЛЬ) I had set up the colation in both database and table to utf8_general_ci. Any helps?

kfh
  • 21
  • 4
  • 1
    What's in phpMyAdmin's `config.inc.php` at `$cfg['DefaultCharset']`? – Philippe Signoret Mar 03 '15 at 17:22
  • I have no line like that. So how to config it as well? – kfh Mar 03 '15 at 17:26
  • What happens if you tell your browser to override the page's character encoding and select UTF-8? – Mike Mar 03 '15 at 17:29
  • In addition to what @Mike says, what happens if you set `$cfg['DefaultCharset'] = 'utf-8';` to `config.inc.php`? – Philippe Signoret Mar 03 '15 at 17:30
  • Thank you, but $cfg['DefaultCharset'] = 'utf-8'; not works, and overriding the page's charater encoding either – kfh Mar 03 '15 at 17:36
  • check here: http://stackoverflow.com/a/4813043/4421474 – Alex Mar 03 '15 at 17:40
  • 1
    possible duplicate of [How to display UTF-8 characters in phpMyAdmin?](http://stackoverflow.com/questions/4777900/how-to-display-utf-8-characters-in-phpmyadmin) – Alex Mar 03 '15 at 17:41
  • `DefaultCharset` hasn't been a configuration option in phpMyAdmin since 2010 (so it was probably removed with version 3.4.0), so unless you've got a very old and unsupported version that's not going to do anything. – Isaac Bennetch Mar 07 '15 at 15:25

1 Answers1

0

German Umlaute in Mysql/Phpmyadmin This worked for me

I struggled with the same problem for a long time. Run this query as soon as you connect to the database and your web application will display characters as they appear in phpmyadmin:

SET NAMES 'utf8'

For some reason MySQL is set up on my systems to assume input and output are encoded as latin1, which means when I send it utf8 input it stores it in the database incorrectly, but because the conversion is reversed for output, the mess is undone and it displays correctly in the browser (except when using phpmyadmin, which displays it faithfully). This is only true when the conversion results in characters that are permitted by the character set used in the database field where it is stored, so you can get errors unless you stop this conversion from happening with the above query.

Community
  • 1
  • 1
kfh
  • 21
  • 4