Welcome Guest, Not a member yet? Register   Sign In
DB Encoding problem with Unicode Chars
#1

[eluser]Galford[/eluser]
Hi all.

I have problem with encoding. The problem is in CI 1.6.1
When I put some text with polish chars like 'łęśź' in database store them as '?'.

Database and tables are configured as utf and utf_general_ci, database is MySQL.

I configured database in CI:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Charset in HTML is utf-8 (charset=utf-8).

I tried to use $this->db->query("SET NAMES 'utf'"); but it doesn't work.

The problem is on my local computer and external server.

When I change CI from 1.6.1 to 1.5.4 the problem disappeared and its work fine just on local machine.

What can be the problem? Please help.
#2

[eluser]Galford[/eluser]
I've changed DB encoding to latin1 and now its work fine, but why id doesn't work with utf8 coding?
#3

[eluser]Huan[/eluser]
Did you try "set names utf8"?
#4

[eluser]Derek Jones[/eluser]
All signs point to the pages not being served as utf-8, as 1.6.1 will connect with that character set to your database, and 1.5.4 will only connect with latin-1. Your server or browser may be forcing the ISO-8859-1 character set even though you are specifying the charset in your HTML. One example is if you send output to the browser before the meta tag with the charset. Have you checked the headers to see what it's actually be transported as?




Theme © iAndrew 2016 - Forum software by © MyBB