• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$_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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.