issues with UTF8 and ANSI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: issues with UTF8 and ANSI (/showthread.php?tid=46473) |
issues with UTF8 and ANSI - El Forum - 11-02-2011 [eluser]Valhallen[/eluser] I'm a bit dumb when it comes to encodings. So please, bear with me. When creating my own content, be it libraries, configs, models, controllers etc, I always encode them in utf8 without bom. I have a live site running PHP5.3.3 (CGI), Apache 2.2.13, Unix with Codeigniter 2.0.2 and Smarty 3.0.8. It works just fine. But recently I started developing it again and at first I used CI 2.0.2 but moved to 2.0.3 and now on to the latest github version. So, the issue is that SOME of my utf8 files are creating whitespace and that screws up the outputted HTML. I did the following tests: First test 1. downloaded latest CI from github 2. created a small library Code: <?php 4. added it to autoload.php all good, so far. no whitespace yet. Second test 1. I created an additional library called Smarty_wrapper with this code: Code: <?php 3. saved it as ansi. this fixed the whitespace issue. Third test 1. saved test.php as ansi. now both the test and smarty wrapper are ansi. all good. works fine. 2. saved smarty wrapper to utf8. now test is ansi and smarty_wrapper is utf8 (this encoding previously created whitespace with given file). works great. no whitespace. -- so these tests show that both libraries can't be simultaneously encoded in utf8. what's going on here? should I convert all my files to ansi? and why hasn't this issue occured with the live version? |