Welcome Guest, Not a member yet? Register   Sign In
Unicode encoding issues in CI
#11

[eluser]n0xie[/eluser]
If it is ISO-8859-1 try:
Code:
$utf8 = utf8_encode($input);
#12

[eluser]Maglok[/eluser]
I think I got it. Can't believe this.

I added the meta tag charset=utf-8.

Apparantly the page just didnt understand it was supposed to use utf-8.

So now the httpd.conf, the mysql, the form AND the html itself have all been told to act like utf-8 and it finally seems to work. Strange markings all over.

Thanks a lot for the help, cause this was just breaking my head.

Tell me one thing though: Why do we have to set it everywhere, why not just use it as default.
#13

[eluser]n0xie[/eluser]
I can't really answer that question. There are a lot of questions I have to some greater deity. Whenever I watch 'My Super Sweet 16' I keep asking myself 'WHY OH WHY FOR THE LOVE OF GOD(S)/SPAGHETTI MONSTER WHYYYYYYYY'.

I just take comfort in the fact that programming -usually- makes sense (at least to me) and there are absolute truths to be found. UTF-8 implementation however is definitely not one of them. The only thing I can say about it is that character encoding is really really hard. There is a reason PHP6 is taking so long. They want to do multibyte string right. They want to do character encoding right. They want you to be able to type your sourcecode in Japanese and do that right too. I would just say stick to what you know works and don't fix if it isn't broken.

Or learn Python.
#14

[eluser]Maglok[/eluser]
Amen. Smile
#15

[eluser]InsiteFX[/eluser]
In your html documents you should always specify the document encoding type. If using HTML5 then they recommend using both meta types for encoding.

Code:
// old way - fallback!
meta http-equiv="content-type" content="text/html;charset=utf-8" />
// HTML5
<meta charset="utf-8">

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB