DataAction / AdoNetCore.AseClient

AdoNetCore.AseClient - a .NET Core DB Provider for SAP ASE
Apache License 2.0
106 stars 44 forks source link

AdoNetCore.AseClient.AseException: 'Server environment changed to unsupported charset ' #89

Closed anawar82 closed 5 years ago

anawar82 commented 5 years ago

I get AdoNetCore.AseClient.AseException: 'Server environment changed to unsupported charset ' when trying to open the connection image

senseibaka commented 5 years ago

Hi @anawar82,

Our driver throws this exception when the server tells it to use a charset it doesn't support. Usually this charset's name would appear at the end of the exception message (throw new AseException($"Server environment changed to unsupported charset {change.NewValue}");), so that's weird.

Can you tell me:

Cheers

anawar82 commented 5 years ago

Code Page 850 (Multilingual)

"SybConnectionString": "Data Source=10.1.254.254; Port=4000; Database=DB; UID=sa; PWD=XYZ; charset=cp850;"

I have also tried without mentioning the charset, and I get the same error.

On Oct 25, 2018, at 1:35 AM, Nicholas Sizer notifications@github.com wrote:

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

Our driver throws this exception when the server tells it to use a charset it doesn't support. Usually this charset's name would appear at the end of the exception message (throw new AseException($"Server environment changed to unsupported charset {change.NewValue}");), so that's weird.

Can you tell me what the charset of your database/server is?

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DataAction/AdoNetCore.AseClient/issues/89#issuecomment-432851668, or mute the thread https://github.com/notifications/unsubscribe-auth/AqLsqX5FQ3GMAQsit_Yg944G6L-duH11ks5uoOsmgaJpZM4X3c05.

senseibaka commented 5 years ago

Thanks @anawar82

So .net core does not natively support ibm850 (refer these msdn remarks). Therefore, the driver in its current state also doesn't support ibm850.

There are a couple of options as to how support could be added to the driver:

  1. Implement an EncodingProvider within the driver's code.
  2. Leverage the System.Text.Encoding.CodePages nuget package - see https://stackoverflow.com/a/37870346/242311

I'm not entirely happy with either option, in particular:

However, the above does not help you use the driver, so here's a third option which might help us both:

Would you be happy with that solution?