Welcome Guest, Not a member yet? Register   Sign In
echo : default charset
#2

[eluser]bl00dshooter[/eluser]
[quote author="Patrick Maciel | @p4designer" date="1289095980"]Hello everbody.

I have one simple question: why not get the CodeIgniter default charset defined in the config.php file to echo (php)?

I'm asking this because if I only want to display a message on the index () function of a controller, such as:
Code:
echo "Olá Mundo!";
I get invalid characters = 'á'.

But to solve this, is theoretically simple, just add this code:
Code:
header ('Content-Type: text / html; charset = utf-8');
, first line of the index ().

I know the HTML meta tags, etc.. But this is not the issue. I wish only to show a message with special characters.

Can you help me and/or explain to me why the CodeIgniter not get the default charset in config.php?

Sorry for my English, I am Brazilian and I need more practice.[/quote]

Arquivo config.php:

Quote:/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = "UTF-8";

Creio que seja isso?
PS: também sou brasileiro.


Messages In This Thread
echo : default charset - by El Forum - 11-06-2010, 03:13 PM
echo : default charset - by El Forum - 11-06-2010, 03:18 PM
echo : default charset - by El Forum - 11-06-2010, 03:48 PM
echo : default charset - by El Forum - 11-06-2010, 03:55 PM
echo : default charset - by El Forum - 11-06-2010, 04:09 PM
echo : default charset - by El Forum - 11-06-2010, 04:26 PM
echo : default charset - by El Forum - 11-06-2010, 06:22 PM
echo : default charset - by El Forum - 11-06-2010, 07:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB