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

code page problem #27

Closed
orenz opened this issue Nov 5, 2012 · 19 comments
Closed

code page problem #27

orenz opened this issue Nov 5, 2012 · 19 comments

Comments

@orenz
Copy link

orenz commented Nov 5, 2012

I use Hebrew code page on mysql.
English letters are Ok, however Hebrew letters come out wrong.
When I use mysql native driver all is OK.
I guess all non UFT8 code pages has the same problem.

@wankdanker
Copy link
Collaborator

Hi @orenz.

What does your connection string look like? Have you tried specifying the charset connection parameter? (http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters.html)

@orenz
Copy link
Author

orenz commented Nov 5, 2012

"ODNC;DSN=kuku;DRIVER=MySQL ODBC 5.2w
Driver;charset=hebrew;SERVER=IWIZMYSQL;UID=WIZSOFT;PWD=xxxx;DATABASE=xxx;"

works with C++ ODBC well

On Mon, Nov 5, 2012 at 5:08 PM, Dan VerWeire notifications@github.comwrote:

Hi @orenz https://github.com/orenz.

What does your connection string look like? Have you tried specifying the
charset connection parameter? (
http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters.html
)


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10073737.

@wankdanker
Copy link
Collaborator

OK. I will have to research this. We just use SQLGetData(..., buffer, ...) to get the values from ODBC and then String::New(buffer). I'm not sure what needs to be done so that V8 will play nice with other code pages.

@wankdanker
Copy link
Collaborator

The issue might be that we were specifying SQL_CHAR for TargetType in the case of

SQLRETURN SQLGetData(
    SQLHSTMT       StatementHandle,
    SQLUSMALLINT   Col_or_Param_Num,
    SQLSMALLINT    TargetType,
    SQLPOINTER     TargetValuePtr,
    SQLLEN         BufferLength,
    SQLLEN *       StrLen_or_IndPtr);

Better results might be had if using SQL_C_WCHAR, but I am not sure. I have tried testing this against my MSSQL server which has some Hebrew characters in an NVARCHAR field, but am not getting those same characters back. Not sure where the problem lies.

If you have working C++ ODBC code, what does your SQLGetData() call look like?

@wankdanker
Copy link
Collaborator

OK, I think I have resolved this issue; at least as far as my tests go. It's going to have to cook for a while though before it makes its way to a release.

The issue was a combination of previously using SQL_CHAR for the TargetType and the buffer being a char* buffer which has been changed to uint16_t* buffer

You can get the code from my v0.4-separation branch:

https://github.com/wankdanker/node-odbc/tree/v0.4-separation

@orenz
Copy link
Author

orenz commented Nov 5, 2012

I really appreciate this.
Hope to test soon, though it might take a few days.

On Mon, Nov 5, 2012 at 9:53 PM, Dan VerWeire notifications@github.comwrote:

OK, I think I have resolved this issue; at least as far as my tests go.
It's going to have to cook for a while though before it makes its way to a
release.

The issue was a combination of previously using SQL_CHAR for the
TargetType and the buffer being a char* buffer which has been changed to uint16_t*
buffer

You can get the code from my v0.4-separation branch:

https://github.com/wankdanker/node-odbc/tree/v0.4-separation


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10085105.

@orenz
Copy link
Author

orenz commented Nov 21, 2012

Hi
I want to check this fix now. how do I install this:
https://github.com/wankdanker/node-odbc/tree/v0.4-separation

@wankdanker
Copy link
Collaborator

Hi @orenz,

You can use npm to install from git repositories if you are on a system that has git; like this:

npm install git://github.com/wankdanker/node-odbc.git#v0.4-separation

Where everything after the # is a branch, tag or commit hash.

It would be nice if you would test the v0.5 branch also/instead. That version has a test runner and some tests which include a Unicode test that may be related to your issue.

npm install git://github.com/wankdanker/node-odbc.git#v0.5

If you are on Windows, you will have to grab a zip file from github of the branch or tag. Here is a link to the v0.5 zip file:

https://github.com/wankdanker/node-odbc/archive/v0.5.zip

Hope this helps,

Dan

@orenz
Copy link
Author

orenz commented Nov 21, 2012

I am on win.
Got the zip, compiled it. Now I get :

odule.js:340
throw err;
^
rror: Cannot find module 'bindings'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (C:\Program
Files\nodejs\node_modules\node-odbc-0.5\odbc
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)

what is wrong ?

On Wed, Nov 21, 2012 at 5:53 PM, Dan VerWeire notifications@github.comwrote:

Hi @orenz https://github.com/orenz,

You can use npm to install from git repositories if you are on a system
that has git; like this:

npm install git://github.com/wankdanker/node-odbc.git#v0.4-separation

Where everything after the # is a branch, tag or commit hash.

It would be nice if you would test the v0.5 branch also/instead. That
version has a test runner and some tests which include a Unicode test that
may be related to your issue.

npm install git://github.com/wankdanker/node-odbc.git#v0.5

If you are on Windows, you will have to grab a zip file from github of the
branch or tag. Here is a link to the v0.5 zip file:

https://github.com/wankdanker/node-odbc/archive/v0.5.zip

Hope this helps,

Dan


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10602443.

@wankdanker
Copy link
Collaborator

run npm install to pull in the bindings module.

@orenz
Copy link
Author

orenz commented Nov 21, 2012

How can I install from a file directory ?

On Wed, Nov 21, 2012 at 6:55 PM, Dan VerWeire notifications@github.comwrote:

run npm install to pull in the bindings module.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10605006.

@wankdanker
Copy link
Collaborator

I'm not sure if I understand what you are asking. But you could also install the bindings module by downloading a zip file from github (https://github.com/TooTallNate/node-bindings/archive/master.zip) and placing the contents in your-odbc-folder/node_modules/bindings

@orenz
Copy link
Author

orenz commented Nov 21, 2012

Sorry , got it working.
Hebrew is not OK though.
does this:https://github.com/wankdanker/node-odbc/archive/v0.5.zip includes
the Hebrew fix ?

On Wed, Nov 21, 2012 at 7:06 PM, Dan VerWeire notifications@github.comwrote:

I'm not sure if I understand what you are asking. But you could also
install the bindings module by downloading a zip file from github (
https://github.com/TooTallNate/node-bindings/archive/master.zip) and
placing the contents in your-odbc-folder/node_modules/bindings


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10605492.

@wankdanker
Copy link
Collaborator

Hi @orenz,

It should include the fix and it work OK for me. But, I may be missing something.

Could you post your MySQL Create Table statement, some insert statements and your select statement for your test case? We need to get on the same page so I can see what is going on.

Thanks,

Dan

@wankdanker
Copy link
Collaborator

I created a quick test case of my own and had to use charset=utf8 in the connection string to get it to work.

@orenz
Copy link
Author

orenz commented Nov 21, 2012

utf8 WORKS !!!,
I used charset=hebrew.

Thanks,

On Wed, Nov 21, 2012 at 7:53 PM, Dan VerWeire notifications@github.comwrote:

I created a quick test case of my own and had to use charset=utf8 in the
connection string to get it to work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10607378.

@orenz
Copy link
Author

orenz commented Nov 22, 2012

on SqlServer if server collation is Hebrew_CI_AS the Hebrew doe's not well

On Wed, Nov 21, 2012 at 10:48 PM, Oren Zbeda oren.zbeda@gmail.com wrote:

utf8 WORKS !!!,
I used charset=hebrew.

Thanks,

On Wed, Nov 21, 2012 at 7:53 PM, Dan VerWeire notifications@github.comwrote:

I created a quick test case of my own and had to use charset=utf8 in the
connection string to get it to work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-10607378.

@wankdanker
Copy link
Collaborator

Hey @orenz, if you are still having this issue, try installing with npm install git://github.com/wankdanker/node-odbc.git or npm install https://github.com/wankdanker/node-odbc/archive/v0.5.16.tar.gz and let me know how it goes.

Thanks,

Dan

@wankdanker
Copy link
Collaborator

This may or may not be fixed here: https://github.com/wankdanker/node-odbc/tree/v0.5.17.

Going to close this issue due to inactivity.

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

No branches or pull requests

2 participants