problem with Arabic language.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hash4sp
    New Member
    • Aug 2007
    • 55

    #1

    problem with Arabic language.

    Hello,

    I have been haunted by this issue for a long time. I have a list of cities in a .DBF file called as "cities1.db f". When i query the Arabic field & try to display in a drop down list, it shows some garbage values & not the actual arabic text.

    Is this something to do with the encoding decoding. Earlier i tried do solve this with the .net Encoding decoding, but couldnt get success.

    Please advise.

    Code:
    .aspx
    ----------
    <body>
        <form id="form1" runat="server">
        <div>
        Cities_Arabic <asp:DropDownList ID="DropDownList1" runat="server" DataValueField ="city_lcase" DataTextField="city_a"></asp:DropDownList>
        </div>
        </form>
    </body>
    
    .aspx.vb
    ------------
    Dim cityName As String = "_cities"
    Dim strSql As String = "SELECT * FROM cities1"
    DropDownList1.DataSource = generalClass.ExecuteDataTableQueryDBF(strSql, cityName)
    DropDownList1.DataBind()
    
    Public Shared Function ExecuteDataTableQueryDBF(ByVal SelectSTR As String, ByVal city As String) As Data.DataTable
            Dim oCnn As New OleDbConnection
            Dim iCount As Integer = 0
            Dim strSql As String
            Dim da As New OleDbDataAdapter
            Dim dt As New DataTable
            Try
                oCnn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString1").ToString + city + System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString2").ToString
    
                If oCnn.State = ConnectionState.Closed Then
                    oCnn.Open()
                End If
    
                strSql = SelectSTR
                da = New OleDb.OleDbDataAdapter(strSql, oCnn)
                da.Fill(dt)
    
            Catch ex As Exception
            Finally
                If oCnn.State = ConnectionState.Open Then
                    oCnn.Close()
                End If
            End Try
            Return dt
        End Function
    Here is a link to the problem screen shot which i am facing.



    Thanks & regards,
  • hash4sp
    New Member
    • Aug 2007
    • 55

    #2
    hello.. is there anyone who can give me some suggestion on this please

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      I think this has a lot to do with the character set that is being used.
      If the character set being used doesn't support Arabic characters then you won't be able to display them..

      Check out this thread on Arabic in ASP.

      Also check out this MSDN article on Character Set Recognition.

      And check out this CodeProject article about Encoding in ASP.NET.

      -Frinny

      Comment

      Working...