Welcome Guest, Not a member yet? Register   Sign In
$_POST empty if there is accent in text
#1

Hi everyone I'm trying to create a bee that accepts a json in post and I realized that if the word "CoupÈ" in the json text is present, the variable $_POST is empty. I'm using codeigniter but I do not think that's the reason. In the codeigniter configuration I see that $config['charset'] = 'UTF-8' is set;
The json I'm trying to receive is this:

Code:
{
   "modelli": [
       {
         "numero": 0,
         "modello": “popoloso”
       },
       {
         "numero": 1,
         "modello": “ooooooo”
       },
       {
         "numero": 3,
         "modello": "CoupÈ"
       }
   ],
   "oraInizio": "21:00",
   "durataProve": 5
}



Any suggestion is useful. thank you so much

Giuseppe
Reply
#2

Check this https://www.codeigniter.com/user_guide/l...input.html
The solution should be $something = $this->input->post('CoupE');

Also make sure your form method is "POST"
There are those who tell lies with meaning behind them and those meaning less lies!
Reply
#3

Here is the error that I get from your sample Json and its not on CoupÈ

Error: Parse error on line 4:
...": 0, "modello": “popoloso” }, {
----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
There are those who tell lies with meaning behind them and those meaning less lies!
Reply
#4

If you are using Javascript try using JSON.stringify(object) and in PHP its json_encode(array) to generate valid JSON.
God Bless CI Contributors Smile
Reply
#5

grazie mille!!!!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB