Welcome Guest, Not a member yet? Register   Sign In
CI can't display UTF8 data that equivalent PHP/mysql code has no trouble with
#11

[eluser]Narf[/eluser]
Btw, a second look points me to another guess - it is quite possible that the data was erroneously encoded while it was inserted (assuming you didn't do that via CodeIgniter).

Another thing that you should take care of is to have the database itself created with default character set utf8 (not just the table).
#12

[eluser]Jeffrey McManus[/eluser]
The database is not where the problem lies. If the database were the problem, then I would not be able to query and display the database correctly using PHP/mysql. (Right?)

That said, SHOW CREATE DATABASE confirms that the database was created with a default character set of UTF8.
#13

[eluser]Jeffrey McManus[/eluser]
I just thought of one more thing to try that pretty much confirms my assertion that this is an issue with CodeIgniter 2.1.x rather than a configuration issue or a problem with the data.

I grabbed a copy of CodeIgniter 3.0-dev from Github, configured it to work against the same database, on one of the same dev machines were I saw the problem last week.

Display of the data works correctly in this scenario. So from this, it's clear that between 2.1.2 and 3.0-dev, something changed with the way that unicode data is being handled. PHP/mysql does it right, CI 3.0-dev does it right, but CI 2.1 does not do it right.
#14

[eluser]Jeffrey McManus[/eluser]
And by trying the same code in a fresh install of CI 2.1.3, I am able to confirm definitively that the unicode problem is a bug in CI 2.1.2.

Thanks for your suggestions for resolving this, Narf.
#15

[eluser]Narf[/eluser]
You're welcome.

However, nothing has changed between 2.1.2 and 2.1.3 that affects this.

EDIT: Links somehow get broken, can't post the compare diff link.




Theme © iAndrew 2016 - Forum software by © MyBB