4
Friends, I have a problem, the string that has accent not being able to catch it using JSON:
$imagens = array();
$sql = mysql_query("SELECT * FROM texto_index");
while ($row = mysql_fetch_row($sql)){
$imagens[] = $row;
}
echo json_encode($imagens);
for example: Prescription comes as null
the array:
Array ( [0] => Array ( [0] => 5 [1] => RECEITUÁRIOS [2] => MASCULINOS [3] => 1 [4] => #ffffff [5] => 56 [6] => 28 [7] => Direita [8] => cache/1404135032s-receituario-feminino-eco2.jpg ) [1] => Array ( [0] => 6 [1] => ÓCULOS [2] => MASCULINOS [3] => 1 [4] => #ffffff [5] => 52 [6] => 20 [7] => esquerda [8] => cache/1404225957262.jpg ) )
Possible duplicate. Is not exactly but solves the same problem, only otherwise.
– Bruno Augusto
@Brunoaugusto I believe not to be because of the language!
– user6026
In addition to the json conversion error, the source also influenced @Furlan?
– user6026
@user6026, the term "language" is different from the term "Encode/charset". Normally, the problem according to what you presented is related to the type of Encode/charset of the data and PHP scripts. Then the first step is to set up the environment and the data for an appropriate Encounter. Recommended is UTF-8. If you really want to solve it the right way, click on the environment. Otherwise, you can solve it by using htmlentities and utf_encode, etc.. In this case it will only make worse what is already bad.. rsr you are the one who chooses.
– Daniel Omine