Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite select, not UTF8 encoding #107

Open
voxsoftware opened this issue Nov 26, 2015 · 3 comments
Open

SQLite select, not UTF8 encoding #107

voxsoftware opened this issue Nov 26, 2015 · 3 comments

Comments

@voxsoftware
Copy link

I write a SQLITE Database, i push rows with string fields in UTF8, but I made SELECT, I get the values in unknown encoding

Example:

db.run("insert into tabla(str) values('ちは')", function(){
   db.all("select str from tabla", function(err, rows){
         var str= rows[0].str; // I get:   ã�¡ã�¯   instead of ちは
   })
})
@ktrzeciaknubisa
Copy link
Member

Yeap, I see this too on desktop jx SM (V8 works ok):

var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');

db.serialize(function () {

  db.run("CREATE TABLE tabla (str TEXT)");
  db.run("insert into tabla(str) values('ちは')", function (err) {
    db.get("select str from tabla", function (err, row) {
      console.log(row.str);
    })
  })
});
$ jxsm test.js 
��
$ jxv8 test.js 
ちは

@obastemur
Copy link
Member

Is this still a case with latest 0.3.10 ?

@ktrzeciaknubisa
Copy link
Member

Yes. Just checked with latest build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants