some utf8 problems... not all - 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: some utf8 problems... not all (/showthread.php?tid=26438) |
some utf8 problems... not all - El Forum - 01-13-2010 [eluser]Marc Arbour[/eluser] Hello. I have a new server and set ip up like I wanted. But there is something strange happening. I have everything set on utf8 in config.php, in my views, my database... Everything is wonderfull as accents show up everywhere but... in my $data variables... In order to show up properly on my webpage, I need to change this Code: $data['page_title'] = 'Bienvenue à '; Code: $data['page_title'] = utf8_encode('Bienvenue à '); Anyone has an idea on how to solve the problem or how to utf8_encode the whole $data array? I did try couple of array_walk tests without any success. Best regards Marc some utf8 problems... not all - El Forum - 01-13-2010 [eluser]Sbioko[/eluser] Use my Codeigniter 1.7.2 UTF-8 Edition and you will not need any magic with UTF8. You can find link to it in my signature. some utf8 problems... not all - El Forum - 01-13-2010 [eluser]Marc Arbour[/eluser] Nope. THis didn't solve my problem. Data from the database still with accents while data from $data variables still with "squared question marks" Anyone else? some utf8 problems... not all - El Forum - 01-13-2010 [eluser]tomcode[/eluser] Guess the file containing the $data declaration is not UTF-8. some utf8 problems... not all - El Forum - 01-14-2010 [eluser]sl3dg3hamm3r[/eluser] The question might be silly, but are you sure you editor saved your files (controller, view) in UTF-8? some utf8 problems... not all - El Forum - 01-14-2010 [eluser]Marc Arbour[/eluser] I checked against dreamweaver config to confirm my editor is set to utf8. But when I cat my files in linux command line, they indeed seems as they were not properly encoded. I checked options in my ftp software (webdrive) only to find an option for utf8 filenames only. Anyone to suggest me a php editor for that will solve my problem? Regards Marc some utf8 problems... not all - El Forum - 01-14-2010 [eluser]sl3dg3hamm3r[/eluser] Here you find a long discussion about plenty of editors... some utf8 problems... not all - El Forum - 01-14-2010 [eluser]Marc Arbour[/eluser] ok, found a solution. But it's not totally sane to do this for all my files in all my sites. After setting the BOM setting in dreamweaver, I was forced to do a file->new then paste the content of the "old" file and then "save as" overwriting the file. My files are now utf8... Does anybody know how I could "automate" this process for all files systematically in dreamweaver? Marc some utf8 problems... not all - El Forum - 01-14-2010 [eluser]Sbioko[/eluser] I worked in Dreamweaver 2 years ago, but today I use NetBeans or Notepad++. Quote:Data from the database still with accents while data from $data variables still with “squared question marks”You need to convert your database to utf8_general_ci and all you php scripts must be converted with "UTF-8 Without BOM". And(if you use my package) use(for example) utf8_strtolower instead of strtolower and all will be fine. |