Connecting Tech Pros Worldwide Help | Site Map

problem with Arabic language.

Member
 
Join Date: Aug 2007
Posts: 50
#1: Aug 30 '09
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.dbf". 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.

Expand|Select|Wrap|Line Numbers
  1. .aspx
  2. ----------
  3. <body>
  4.     <form id="form1" runat="server">
  5.     <div>
  6.     Cities_Arabic <asp:DropDownList ID="DropDownList1" runat="server" DataValueField ="city_lcase" DataTextField="city_a"></asp:DropDownList>
  7.     </div>
  8.     </form>
  9. </body>
  10.  
  11. .aspx.vb
  12. ------------
  13. Dim cityName As String = "_cities"
  14. Dim strSql As String = "SELECT * FROM cities1"
  15. DropDownList1.DataSource = generalClass.ExecuteDataTableQueryDBF(strSql, cityName)
  16. DropDownList1.DataBind()
  17.  
  18. Public Shared Function ExecuteDataTableQueryDBF(ByVal SelectSTR As String, ByVal city As String) As Data.DataTable
  19.         Dim oCnn As New OleDbConnection
  20.         Dim iCount As Integer = 0
  21.         Dim strSql As String
  22.         Dim da As New OleDbDataAdapter
  23.         Dim dt As New DataTable
  24.         Try
  25.             oCnn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString1").ToString + city + System.Configuration.ConfigurationManager.AppSettings("DBFConnetionString2").ToString
  26.  
  27.             If oCnn.State = ConnectionState.Closed Then
  28.                 oCnn.Open()
  29.             End If
  30.  
  31.             strSql = SelectSTR
  32.             da = New OleDb.OleDbDataAdapter(strSql, oCnn)
  33.             da.Fill(dt)
  34.  
  35.         Catch ex As Exception
  36.         Finally
  37.             If oCnn.State = ConnectionState.Open Then
  38.                 oCnn.Close()
  39.             End If
  40.         End Try
  41.         Return dt
  42.     End Function
Here is a link to the problem screen shot which i am facing.

http://picasaweb.google.com/lh/photo...eat=directlink

Thanks & regards,
Member
 
Join Date: Aug 2007
Posts: 50
#2: 4 Days Ago

re: problem with Arabic language.


hello.. is there anyone who can give me some suggestion on this please
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,083
#3: 4 Days Ago

re: problem with Arabic language.


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
Reply

Tags
.dbf, ansi, arabic language, decoding, encoding