-1

I'm trying to retrieve a string from MySQL that contains japanese characters. I'm using

$handle = new PDO("mysql:dbname=" . DATABASE . ";host=" . SERVER . ";charset=utf8", USERNAME, PASSWORD);

to connect to the database, and i can store the string just fine, using the same method to connect. It shows up like this

pic #1

But when i retrieve it using the same method to print it to a web page it'll just show ? instead of the characters. Like this http://puu.sh/bd1fX.png. The characters after "Name" are hardcoded here for testing purposes.

pic #2

Here's the function i'm using to connect and retrieve data http://pastebin.com/7jj7MLjd

If anyone has any suggestions as to why i can't get the characters back from the databse, that'd be great.

Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116

1 Answers1

0

Check whether your html file is set to support utf-8 characters?

I mean <meta charset="utf-8"> is there in <head> section?

Syntax Error
  • 269
  • 2
  • 11
  • The thing is that when the string is returned from the function the letters are already ??? before they're printed to the html form. But i also do have meta charset defined already. – user3785768 Sep 07 '14 at 13:18