Welcome Guest, Not a member yet? Register   Sign In
Charset ISO-8859-1
#1

[eluser]WebbHelp[/eluser]
Hi!

I begun yesterday with CodeIgniter, and now I got the first real problem (lucky me Tongue)
The thing is when I go to my website, I got problem with characters.
The charset I need to use to get this work is: Charset ISO-8859-1

Because åäö doesn't work(doesn't know if you can se wich characters) because it is letters in swedish...

How can I change my charset.
My files i encode as Charset ISO-8859-1, but that doesn't help, it doesn't work.

Thanks Smile
#2

[eluser]wabu[/eluser]
Hello, it might be helpful if you could post more information about the problem.

Are you seeing an error message or are the proper characters just not displaying? Basically, is this an input or output problem (from your post it seems like it might be output-related)?
#3

[eluser]WebbHelp[/eluser]
yes the problem is the text that I output from the database with echo in PHP.

The characters Å Ä Ö displays very strange...

It is wrong charset, or they are mixed together, the charset.

I don't know, strange letters when I output from my Database not if I only use echo and write something
#4

[eluser]rogierb[/eluser]
use
<code>
&lt;meta http-equiv = "Content-Type" content = "text/html; charset=ISO-8859-1"&gt;
</code>

In your html head and make sure your database and table are ISO-8859-1

These need to be the same charset. To mee it seems the table, browser or datase have a different charset then iSO-8859-1
#5

[eluser]WebbHelp[/eluser]
Thanks for reply Smile

The documents is correct charset, and the database: latin1_swedish_c
This has been working everytime when I didn't used CodeIgniter, Can i configurate something in CodeIgniter?
#6

[eluser]rogierb[/eluser]
try the config file:
$config['charset'] = "ISO-8859-1";

Maybe that will help.
#7

[eluser]WebbHelp[/eluser]
i have already tried that without no success.

I also tried in database.php:

$db['default']['char_set'] = "latin1_swedish_ci";
$db['default']['dbcollat'] = "latin1_swedish_ci";

But no success:

öåöäöååÃ
#8

[eluser]davidbehler[/eluser]
There are some points you have to consider when choosing a charset, you might want to check out Phil's or my article on using UTF-8 with CodeIgniter.
I think everything we said about UTF-8 should be true for ISO-8859-1 aswell.
#9

[eluser]rogierb[/eluser]
Try utf8_decode() around the database string and see if that works.
If so, there is still a problem with inserting and/or getting data from the database
#10

[eluser]wabu[/eluser]
Could you try adding the following meta element to your template?

Code:
&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;

I'm able to reproduce and solve the problem this way (with static text "Åå, Ää, and Öö" displaying correctly in a template--no db required to test).




Theme © iAndrew 2016 - Forum software by © MyBB