SHT
SHT

Reputation: 720

PHP MySQL return special characters

How can I make this query also return special characters/danish letters (å, æ, ø)?

$sql = "SELECT artist_id, formated_name FROM artists WHERE formated_name LIKE '".$letter."%'";
$query = $this->db->query($sql);
$data = $query->result();

I read something about regex or str_replace?

right now it returns %C3%A6 - when it comes to these letters...

thanks in advance...

Upvotes: 1

Views: 633

Answers (1)

Quentin
Quentin

Reputation: 943142

%C3%A6 is percent encoded data.

You can decode it with urldecode.

It is an odd choice of format for data stored in a database, so you should probably look into fixing whatever adds the data to the database so that it stores the actual characters instead of the percent encoded versions of them.

Upvotes: 1

Related Questions