SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Location
    Sao Paulo, Brazil
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Phpmyadmin inserting text as ISO-8859-1 into Mysql, how can I make it insert as UTF-8

    Hi

    I'm pretty sure my phpmyadmin install(on windows) is inserting text as ISO-8859-1 into Mysql, is it possible to make it insert text encoded in UTF-8?

    I added the following lines to phpmyadmin's config.inc. php file:

    PHP Code:
    $cfg['DefaultLang'] = 'en-utf-8';
    $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
    $cfg['DefaultCharset'] = 'utf-8'
    and still no luck

    tables and databases collation set to utf8_general_ci

    when I use a php script to display the data entered via phpmyadmin, it shows that weird fffd box in place of characters such as etc... the php script has a meta charset set to utf-8 as well

    if I use php's utf8_encode function before echoing the data retrieved from mysql, it shows up fine too

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    after connecting to the database, you should execute the query

    Code:
    SET NAMES UTF8
    This would make the data be inserted as UTF8.
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Location
    Sao Paulo, Brazil
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    after connecting to the database, you should execute the query

    Code:
    SET NAMES UTF8
    This would make the data be inserted as UTF8.
    you can't do that using phpmyadmin's INSERT tab


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •