Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

309
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda