CodeIgniter Forums
problems with umlauts. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: problems with umlauts. (/thread-32359.html)

Pages: 1 2


problems with umlauts. - El Forum - 07-21-2010

[eluser]helle[/eluser]
if i get_post a variable from i.e. an ajax request with

Code:
$this->input->get_post('name')
i get
Code:
hüdelü 5

but over the native php way
Code:
$_REQUEST
i get
Code:
hüdelü 5
, which would be the right value.

i looked into the input.php and saw that there is some xss cleaning stuff, which i don't want to loose. has anybody written a xss_clean method for CI which can handle umlauts?

thanks in advice ;-)


problems with umlauts. - El Forum - 07-21-2010

[eluser]Clooner[/eluser]
It seems that there is a problem with the content-type charset. It seems that this isn't set and probably in your browser will display correcty(autodetect) but with an ajax request messing it up


problems with umlauts. - El Forum - 07-21-2010

[eluser]helle[/eluser]
the output was not in the browser, but in the logfile on a linux machine.

by the way: i set
Code:
<meta charset="UTF-8" />

p.s.:
sorry, if my politenes is missing, i am damn angry on myself having that problem :-D


problems with umlauts. - El Forum - 07-21-2010

[eluser]Clooner[/eluser]
[quote author="helle" date="1279722874"]the output was not in the browser, but in the logfile on a linux machine.

by the way: i set
Code:
<meta charset="UTF-8" />

p.s.:
sorry, if my politenes is missing, i am damn angry on myself having that problem :-D[/quote]

I believe you have to correctly set the content-type with a charset associated with that
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">



problems with umlauts. - El Forum - 07-21-2010

[eluser]helle[/eluser]
thanks, i'll try that out


problems with umlauts. - El Forum - 07-21-2010

[eluser]helle[/eluser]
no the prolbem still exists


problems with umlauts. - El Forum - 07-21-2010

[eluser]Clooner[/eluser]
[quote author="helle" date="1279723372"]no the prolbem still exists[/quote]
Actually
Code:
hüdelü 5
is the correct one! This is utf-8 and will be rendered correctly when using the correct content-type in browsers.


problems with umlauts. - El Forum - 07-21-2010

[eluser]Clooner[/eluser]
Then change the charset to which you need in the config:
Code:
$config['charset']= "cp1252";
to set it specific to windows default charset


problems with umlauts. - El Forum - 07-21-2010

[eluser]helle[/eluser]
what does this mean? what is the effect of changing to windows default??


problems with umlauts. - El Forum - 07-21-2010

[eluser]Clooner[/eluser]
[quote author="helle" date="1279725571"]what does this mean? what is the effect of changing to windows default??[/quote] I'm not sure but I think the input class parses the input to match the charset defined in the config file. This makes the input switch from the default windows charset to the utf-8 charset. Changing the config from utf-8 to the windows default will in this case most likely fix your problem. (If you are developing on windows)