0

I have a database that contains the data as in the following picture

enter image description here

Notes:

  1. Collation Database ('SQL_Latin1.General_CP1_CI_AS').
  2. I have no right to change Collation to Araic_CI_AS.
  3. In case you change Collation to Araic_CI_AS, the data display from the database is displayed in the new program, but the program has a problem and it appears in the old program in the form of ????? Where the old program.
  4. I can not modify the old program because there is no source code for it.

This database is outdated and may not be modified by anyone ( Collation [rows] or Collation [databases])

When you link the database to a new standalone program through Visual Basic 2015 to use some data from the database, the following format appears as in the picture...

enter image description here

What I want is to display the content of the database to change the (ãßÇÆä æÂáÇÊ) sentence to the default language which is Arabic.

I hope to find a solution through the Visual Basic code and not through the amendment to the database.

Thanks to all

  • I would post an answer to this but someone whispered in my ears "THIS IS TOO BROAD" .... Anyways, [Read this first](https://stackoverflow.com/questions/2246017/using-google-translate-in-c-sharp) , it will help u make the translator, then you need to use a `IDataReader` and translate each column data as u lop through the rows and finally display em in ur dgvw – Software Dev Apr 19 '18 at 14:48
  • 1
    As I understand the problem it is not about translation but about encoding. So please try to specify encoding of the text in the database. It can be useful to concentrate to one character only. – IvanH Apr 21 '18 at 19:33
  • All I want is to read the coding from the database to complete its presentation in Arabic since all the data already exists in the database and I need to complete the use of that database in another project – Hesham Mohamed Apr 28 '18 at 14:27
  • I am amazed that there is no answer to the solution while the database is working on the program and Tom to review each of those symbols in Arabic normal but unfortunately there is no source of the program can not use the code – Hesham Mohamed Apr 28 '18 at 15:53

1 Answers1

0

The problem has been solved in the process of converting the encoding characters by the following code:

Private Function conv1256(ByVal txt As String) As String
    Dim dic As New Dictionary(Of String, String)
    Const _1256 As String = "ÐÏÌÍÎåÚÛÝÞËÕÖØßãäÊÇáÈíÓÔÙÒæÉìÑÄÁÆøºÅñõðó¡ÜÃòö¿Âú"
    Const _utf8 As String = "ذدجحخهعغفقثصضطكمنتالبيسشظزوةىرؤءئّ؛إًٌَُ،ـأٍِ؟آْ"
    For i = 0 To (_1256.Length) - 1
        dic.Add(_1256.Chars(i), _utf8.Chars(i))
    Next i
    For Each ch In txt
        conv1256 &= If(dic.ContainsKey(ch), dic.Item(ch), ch)
    Next
End Function

To be used this way:

MsgBox(conv1256("ÈÓãö Çááå ÇáÑøÍãä ÇáÑøÍíã"))

Good luck and thank you all