sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node
Apache License 2.0
39 stars 36 forks source link

UTF-8 Error #16

Closed finedays closed 8 years ago

finedays commented 8 years ago

Hi, I am having the following error:

Error: Code: -869 Msg: Database server cannot convert data from/to character set 'UTF-8'

Where I can set the desired encoding for the connection?

Thanks!

gperrow-SAP commented 8 years ago

You can use the CHARSET connection parameter to set the character set to be used for a connection. This parameter is documented here (this is documentation for SQLA v17, though the parameter is the same in other versions).

This is not specific to the node.js driver, so if you still have trouble, you may want to post a question at http://sqlanywhere-forum.sap.com/.

finedays commented 8 years ago

Hi,

I asked the question there, but no one seems to have a solution.. http://sqlanywhere-forum.sap.com/questions/27543/how-to-set-charset-using-nodejs-driver-with-osx If you can help me a little bit more I will be very very happy :)

gperrow-SAP commented 8 years ago

The question has only been open a few hours. Most of the SQL Anywhere team is in Waterloo, Ontario, Canada, where almost nobody has seen it yet (it was asked at 4am local time). It's also Canada Day today so most Canadians are not working.

finedays commented 8 years ago

Ok. Finally I fixed it by replacing the 'UTF-8' to 'UTF8' into sqlanywhere.cpp and sqlanywhere_v0_10.cpp files and rebuilt the driver with node-gyp.

hagen commented 5 years ago

Should this be changed in the cpp files then? What's the actual issue here? I'm getting the same error. @finedays I attempted to rebuild on Win also, but it's complaining about missing csproj. @gperrow-SAP the connection options don't support the CharSet prop - where can this be configured. It looks like the string UTF-8 is hard-coded in the cpp file?