gilbitron / Arrest-MySQL

A "plug-n-play" RESTful API for your MySQL database.
131 stars 219 forks source link

Values with "é" or "è" cause responses to show NULL #2

Open michaelyork opened 11 years ago

ludesign commented 11 years ago

This is a wide known issue; You must encode characters to utf8 before passing them to json_encode. Add this piece of code

// map to utf8 to avoid broken json
$result = array_map('utf8_encode', $result);

right after (below)

if($result = $this->db->fetch_array()){

in lib/arrest-mysql.php file.