Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow Environment encoding to be set from JS land #28

Closed
mariano opened this Issue · 3 comments

2 participants

@mariano
Owner

This refers to #26: Environment encoding should be able to be set from JS land.

@mariano mariano was assigned
@mariano mariano closed this in 328fae5
@roymax

@mariano confirmed, all is ok.

you can set Environment encoding NLS_LANG and NLS_NCHAR in JS land

process.env['NLS_LANG']='SIMPLIFIED CHINESE_CHINA.AL32UTF8';
process.env['NLS_NCHAR']='SIMPLIFIED CHINESE_CHINA.ZHS16GBK';

var oracle = require('db-oracle');

new oracle.Database({hostname : 'localhost',
                                          user : 'test',
                    password : 'test',
                    database :'grid'
 }).connect(function(error) {
//do sth here.....
});
@mariano
Owner

@roymax: that's great, but could you try the new charset and ncharset args? So the above example you gave would be instead (notice how i am not using process.env):

var oracle = require('db-oracle');
new oracle.Database({
    hostname: 'localhost',
    user: 'test',
    password: 'test',
    database: 'grid',
    charset: 'SIMPLIFIED CHINESE_CHINA.AL32UTF8',
    ncharset: 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
}).connect(function(error) {
    //do sth here....
});

You will obviously have to build from the GIT repository, or update the latest db-oracle

@roymax

Yes, I have been tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.