Welcome Guest, Not a member yet? Register   Sign In
problems with umlauts.
#1

[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 ;-)
#2

[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
#3

[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
#4

[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">
#5

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

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

[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.
#8

[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
#9

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

[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)




Theme © iAndrew 2016 - Forum software by © MyBB