CodeIgniter Forums
Help with special characters. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help with special characters. (/showthread.php?tid=28818)



Help with special characters. - El Forum - 03-22-2010

[eluser]NachoF[/eluser]
Im having a problem with spanish special characters (ñ,á,é,í,ó,ú)... Im getting the exact opposite outcome of what I expect.. When I set my view file encoding to be UTF-8 I get weird characters but if I set my view file to be ansi encoded it shows fine on my browser.... should utf handle these characters and ansi NOT handle them??... this is getting tricky please help/


Help with special characters. - El Forum - 03-22-2010

[eluser]Tominator[/eluser]
OK, make sure you have:
1, Save file in UTF-8
2, <meta> tag is set to UTF-8

If you are retieving data from DB, make sure, you:
1, Set DB encoding to UTF-8
2, Set table encoding to UTF-8
3, Set field encoding to UTF-8
4, Set connection encoding to UTF-8

When you are doing some operations with string (substr ...) make sur, that you are using mb_functions and you set it to UTF-8.

I think, it helps.