Welcome Guest, Not a member yet? Register   Sign In
my problems are html encoding? (I use utf8)
#1

[eluser]sunyoupk[/eluser]
Hi~ I'm working korean web page. I have problems....
my view page name is "blog_post"(this page is write entrie page)

(Korean is two byte unicode so I always using utf-8)
current working page charset is utf-8 but language is crashed in browser(?!)
but the MySQL database that is a very good character to come calling
(database field type = varchar, characterset = utf8)

my code...
Code:
...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
....
....
<select name="categories" size="1">
    <option value="">카테고리를 선택해주세요</option>(<-crashed sector)
    &lt;?php foreach($query->result() as $row):?&gt;
    <option value="&lt;?=$row->seq?&gt;">&lt;?=$row->cat_name?&gt;</option>(<-Korean word)
    &lt;?php endforeach;?&gt;
</select>

Why are directly expressed in the article is broken HTML pages, MySQL database or taken from the show?
#2

[eluser]webthink[/eluser]
Assuming that MySQL db and tables are set to utf8 (check that), I'm guessing that the problem is that SET NAMES = ‘UTF-8’ is not being issued before interacting with the db.

In Codeigniter 1.6.1, this is automatic, if you set in config:

Code:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Otherwise, I think you'll need to manually

Code:
$this->db->query("SET NAMES 'utf8'");

Before reading or writing.




Theme © iAndrew 2016 - Forum software by © MyBB