Displaying Arabic Characters on ASP .NET

Rate It (1)

Last post 01-07-2008 4:29 AM by zainal. 4 replies.

Sort Posts:

  • Displaying Arabic Characters on ASP .NET

    10-25-2005, 10:08 AM
    • Member
      5 point Member
    • bhaumik.shah
    • Member since 10-25-2005, 1:57 PM
    • Posts 1

    Hi,

    I have problem of displaying Arabic Characters on my webpage ..
    Problem is Data that is stored in Oracle Database is non-unicode. Now
    I am getting Data from Oracle Through OracleDataReader Object

    OracleDataReader myReader = OracleHelper.ExecuteReader()

    I cannot use GetString() method as it will not return Proper Characters.
    so I Tried GetBytes()  Methods.
    byte[] byteCname;
    while (myReader.Read())
    {
    int CNUM = myReader.GetInt32(0);
    byteCname=new byte[myReader.GetString(2).Length];
    myReader.GetBytes(2,0,byteCname,0,results.GetString(2).Length);   

    //want to specify Encoding Here.

    Encoding iso = Encoding.GetEncoding("windows-1256");

    CNAMA=iso.GetString(byteCname);

    }
    that is what i m trying
    which is giving Specified Cast Invalid when GetBytes is called ...

    Plz Help me..

    Thanx in advance
    Bhaumik

    How could I get the correct value

  • Re: Displaying Arabic Characters on ASP .NET

    11-29-2005, 5:18 AM
    • Member
      15 point Member
    • indukp
    • Member since 11-29-2005, 10:15 AM
    • Posts 3
    Hi,

    Im also in the same trouble. I need to fetch some arabic names from the oracle db and i use OracleDataReader to fetch the data. But im getting an error thr  itself telling
    System.Data.OracleClient.OracleException: ORA-00911: invalid character

    in
    Dim dr As OracleDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)


    If u got a solution pls pass it on to me also,

    Thanks in advance
    Indu
  • Re: Displaying Arabic Characters on ASP .NET

    01-19-2006, 6:09 AM
    • Member
      5 point Member
    • steve_awali
    • Member since 01-19-2006, 11:04 AM
    • Posts 1

    System.Data.Odbc.OdbcCommand com = new System.Data.Odbc.OdbcCommand("SELECT AMGEN.GEN_LABEL_LANGUAGES.NAME FROM AMGEN.GEN_LABEL_LANGUAGES WHERE (AMGEN.GEN_LABEL_LANGUAGES.LANGUAGE_ID='LNG1') ");

    com.Connection = connection;

    connection.Open();

    string s = com.ExecuteScalar().ToString();

    connection.Close();

    //converting text from (arabic-windows) code to (UTF-8) code so it will be displayed on the active server page

    Byte[] encodedBytes = System.Text.Encoding.GetEncoding(1256).GetBytes(s);

    TextBox1.Text = System.Text.Encoding.UTF8.GetString(encodedBytes);

    //but i have a defferent problem which is how to solve this problem using ASP.NET not C#

     

  • Re: Displaying Arabic Characters on ASP .NET

    01-24-2006, 2:12 PM
    • Participant
      1,910 point Participant
    • SimonCal
    • Member since 06-10-2002, 8:43 PM
    • Posts 381
    • AspNetTeam
      Moderator
    Steve, when you say you have an AP.NET problem can you provide more details?  Are you using a custom resourceprovider in ASP.NET 2.0 and have issues with that, or are you doing everything programmatically ?
    Simon
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Displaying Arabic Characters on ASP .NET

    01-07-2008, 4:29 AM
    • Member
      4 point Member
    • zainal
    • Member since 07-03-2007, 4:48 AM
    • Bahrain
    • Posts 15

     Hello!

    I have recently come accross this problem and found this link to be helpful:

    http://oracle.ittoolbox.com/documents/popular-q-and-a/supporting-arabic-language-in-database-3613#

    Basically our DBA configured the database to store arabic, then we had to configure the client machines (the servers we use for ASP.NET development and the production server) by changing the NLS_LANG key in the registry entry for the oracle home to AMERICAN_AMERICA.AR8MSWIN1256.

    Did not need to do any encoding!

     

    HTH 

    regards,
    Ahmed Zainal
Page 1 of 1 (5 items)