Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
Arabic characters showing as garbage in .Net when getting data from Sybase

I am trying to display Arabic characters from Sybase database using .Net Windows Forms application but they appear as garbage. I am using ODBC.

If I use ADO.Net then characters are displayed fine so the problem is only in ODBC (and OlEDB which I have also tried)

I tried to user CharSet=UTF8 in ODBC connection string but I started getting error Invalid character conversion. Here's my connecting string:

<add name="SybaseString" connectionString="DSN=myDatabase;UID=sa;PWD=sa123;CharSet=utf8" />

While displaying I am not doing anything fancy, just directly displaying data like this reader["ArabicName"].ToString()

There is no issue with how data is stored in database because when using ADO.Net it works fine. How do I fix this issue?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ok using character set cp1256 in connection string fixed the issue. So final connection string would look like this:

<add name="SybaseString" connectionString="DSN=myDatabase;UID=sa;PWD=sa123;CharSet=cp1256" />

How I found out? First I ran this command sp_helpsort to find out character set used by the database. There I saw that the char set is cp1256 so I used the same and now it is working fine.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!