httpwebresponse not support arabic language !!!!

I have to useing httpwebresponse for two pages, One is jsp and other asp.

the charset is UTF-8 for both of them,

while reading for jsp the arabic character are readed but in asp are not readed it come as spaces

In asp page I use that code <%response,charset="UTF-8"%>

what is the problem




Answer this question

httpwebresponse not support arabic language !!!!

  • Godwin Festus J. Daniel

    The response depends on the asp page. You have to fix your asp page first.

    I checked your page asp page and the encoding is not UTF-8. You can check the encoding in the browser and you can see it is Windows Arabic.

    I'm not familiar with VB 6.0 but there should be a way to htmlencode your string before posting it on the ASP page.


  • James Atkin

    I forgot to tell you where HTMLEncode is:
    You have to add reference to System.Web


  • cowanm

    Is there any answer

  • Edamepsel

    The same concept applies. The source string should be correct (I mean UTF-8). You need to enforce UTF-8 encoding in the result page from Oracle. You can either check with Oracle support on how to do this or you could change the encoding yourself in the code.
  • Steve Cook MSFT

    Try to URL Encode the Arabic parameters before you pass them from one page to the other. In ASP.NET you can use:

    Server.URLEncode("ArabicText");


  • sunslight

    Thanks Friend

    What I did is: change the page unicode from tool menu --> view --> encoding --> UTF-8

    and save page as unicoding 1251.

    and when I have recieve the respone it will come as correct arabic characters.

    .............

    Now, my asp page reading from Oracle database (UTF-8)

    the arabic characters come as spaces ..

    I had tried to used response.charset ="UTF-8"

    but also not solved

    soo how can do this



  • Yuri Savinov

    You need to post the non-ascii data properly on the server, this is a sample code to do so:

    Try

    Dim PostString As String = TextBox2.Text

    Dim postData As String

    postData = "PostString=" + System.Web.HttpUtility.HtmlEncode(System.Web.HttpUtility.UrlEncode(PostString))

    Dim PostReq As HttpWebRequest

    PostReq = CType(WebRequest.Create("http://www.smsmsg.net/test/testHttpRequest.asp"), HttpWebRequest)

    PostReq.Method = "POST"

    PostReq.AllowAutoRedirect = False

    PostReq.ContentType = "multipart/form-data"

    PostReq.ContentLength = postData.Length

    Dim buffer As Byte()

    buffer = System.Text.Encoding.UTF8.GetBytes(postData)

    Dim reqstream As Stream

    reqstream = PostReq.GetRequestStream()

    reqstream.Write(buffer, 0, buffer.Length)

    reqstream.Close()

    Dim response As HttpWebResponse

    response = CType(PostReq.GetResponse(), HttpWebResponse)

    If response.StatusCode <> HttpStatusCode.OK Then

    MsgBox(response.StatusCode)

    End If

    MsgBox("End POST")

    Catch ex As WebException

    MsgBox(ex.Message)

    End Try


  • Benjamino

    it is UTF-8 right now,

    I'm using vb.net 2005

    I'm waiting for your reply.



  • MSwift

    I'm not going to send any datafrom client machine, bcause the data has already in the asp page as a fixed text.

    why I need all this details in sending

    Just I want to read response.

    And, I couldn't find the namespace of ( System.Web.HttpUtility.HtmlEncode)



  • Lakewise

    Arabic characters appear as boxes in the server page, check http://www.smsmsg.net/test/testHttpRequest.asp
    You have to save the page as UTF-8 using VS or even notepad.
    Make sure that your source page is correct and your client will work correctly.

  • Gerhard

    thanks

    I think you didn't get me. what I mean is, when I read response from the windows application using httpwebresponse the arabic characters come as a space.

    I tried to read same response as html in the explorer and it gives correct arabic character, that mean it doesn't come as space.

    in other word, when I read the arabic character for asp page into windows application form using httpwebresponse, it come as a aspace.

    and when I read same ersponse form the internet explorer it some correctly.



  • msnashok

    My Oracle database is already setting to UTF-8.

    Now, I had tried to save the asp file as UTF Encoding,

    also using asp code

    <%response.charset = "UTF-8" %>

    all of this not change any thing

    note, when I have used <%response.charset = "UTF-8" %>, in the httpwebresponse character encoding change to UTF-8, that mean that page gives response as UTF-8.

    so, what is your advises



  • cydrakonis

    Please attach the code to repro
  • Allen White

    Ok, That is

    try to download it from the link below:

    http://www.smsmsg.net/test/Test_httpwebresponse.zip



  • httpwebresponse not support arabic language !!!!