-1

I tried to query some Unicode content in MySQL to NodeJS page. I tried to set db and table collate to utf8_general_ci. This is how my connecting creation looks like:

var connection = mysql.createConnection({
                host     : helpers.config.database.host,
                user     : helpers.config.database.username,
                password : helpers.config.database.password,
                database : helpers.config.database.database,
                charset : 'utf8_general_ci'
                });

But almost the unicode characters become '?', Any solution for this?

This is how it looks -

enter image description here

Techidiot
  • 1,921
  • 1
  • 15
  • 28
Visual Do
  • 11
  • 6

1 Answers1

0

You should also set charset in response as follows. Check if your database/table uses utf8 as @Joerg suggested first.

response.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});  
msaint
  • 91
  • 7