[HELP] UTF-8 file gives me a headache

Hi there everyone,

For my website i basically have a lang.en.php file in root/translations/lang.en.php

I include this file in every controller, and it contains lines like:
define('WELCOME',   'Welcome back'  );
define('ADMIN_PANEL_OVERVIEW','Administration panel overview');
define('NEWS_MANAGER','News Manager');

This works fine and it nicely shows me the actual text in the views when i load them.


In order to translate the admin panel to greek (utf-8), I tried to convert the lang.php document to utf-8 with notepad++, and uploaded it as lang.gr.php.

(note: If i don't change it to utf-encoded php file, the website will show trash, regardless of a header content type set as utf-8 or not (!)).

With the identical file (but UTF-8 rather than ANSI) Codeigniter spits me the message "Warning headers already sent" on a redirect-page. Wtith the exact same file in english but ANSI this doesn't happen.

Does anyone has any idea how this comes, and how can I can find a solution for this other than:




[eluser]Eric Barnes[/eluser]
I think the problem is a hidden character just before the opening php in the file. I ran into this before and the only way I could fix it was to recreate the file starting with UTF-8.

Have a look at this thread: forums/viewreply/587937/

By the way: CodeIgniter already has a language class: libraries/language.html
Quote:The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

I had the same issue before, and the problem was some kind of whitespace AFTER the ?> tag. But i am sure it doesnt have that now Smile



Pete - that worked, thank you!



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.