Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9050805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:44:44+00:00 2026-06-16T12:44:44+00:00

My database and tables are set to utf8_general_ci collation and utf8 charset. CodeIgniter is

  • 0

My database and tables are set to utf8_general_ci collation and utf8 charset. CodeIgniter is set to utf8. I’ve added meta tag charset=utf8, and I’m still getting something like: квартиры instead of cyrillic letters…

The same code running on the local machine works fine – Mac OSX. It’s only breaking in the production machine, which is Ubuntu 11.10 64bit in AWS EC2. Static content from the .php files show up correctly, only the data coming from the database are messed up. Example page: http://dev.uzlist.com/browse/cat/nkv

Any ideas why?

Thanks.

FYI:
When I do error_log() the data coming from the database, it’s the same values I’m seeing on the page. Hence, it’s not the browser-server issue. It’s something between mysql and php, since when I run SELECT * FROM categories, it shows the data in the right format. I’m using PHP CodeIgniter framework for database connection and query and as mentioned here, I have configured it to use utf8 connection and utf8_general_ci collation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:44:45+00:00Added an answer on June 16, 2026 at 12:44 pm

    After 2 days of fighting this bug, finally figured out the issue. Thanks for @yourcommonsense, @robsquires, and a friend of mine from work for good resources that helped to debug the issue.

    The issue was that at the time of the sql file dump to the database (import), charset for server, database, client, and connection was set to latin1 (status command helped to figure that out). So the command line was set to latin1 as well, which is why it was showing the right characters, but the connection with the PHP code was UTF8 and it was trying to encode it again. Ended up with double encoding.

    Solution:

    1. mysqldump the tables and the data (while in latin1)
    2. dump the database
    3. set the default charsets to UTF8 in /etc/my.cnf as Rob Squires mentioned
    4. restart the mysql
    5. create the database again with the right charset and collation
    6. dump the file back into it

    And it works fine.

    Thanks all for contribution!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am extracting text from a MySQL database table, collation is set to utf8_general_ci.
I have an SQL database with a set of tables that have Unique Id's.
If you have a set of tables in the database that strictly consist of
I've got my database set up with three tables - code, tags, and code_tags
I have a MySQL database set-up in a hierarchy style. There are 4 tables
I'm using a particular database table like a Set data structure, i.e., you can
I've created database, for example 'mydb'. CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin;
I'm having problems getting CodeIgniter to work with SQLite3. Here are my database.php configs:
Ok, quick question regarding charset/collation. If I have a database where the collation_database=latin1_swedish_ci but
In my database, the collation was originally utf8_general_ci . However, I noticed that utf8_unicode_ci

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.