Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Passing Arabic characters in a query string

Passing Arabic characters in a query string

Scheduled Pinned Locked Moved ASP.NET
csharpdatabase
4 Posts 3 Posters 9 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chetanfcc
    wrote on last edited by
    #1

    Hi All, I am using httpwebrequest (vb.Net) to make a call to a url ("GET" request). The call works fine when all the query string parameters are in english. I can make the URL call from a web-browser using Arabic characters and get a response as well. But when i try passing Arabic characters as a querystring parameter through the httpwebrequest object, the characters appear garbled. Is there any way I can prevent this from happening, maybe by using some sort of encoding or is there any other workaround available. Thanks in advance guys, Chetan

    C 1 Reply Last reply
    0
    • C Chetanfcc

      Hi All, I am using httpwebrequest (vb.Net) to make a call to a url ("GET" request). The call works fine when all the query string parameters are in english. I can make the URL call from a web-browser using Arabic characters and get a response as well. But when i try passing Arabic characters as a querystring parameter through the httpwebrequest object, the characters appear garbled. Is there any way I can prevent this from happening, maybe by using some sort of encoding or is there any other workaround available. Thanks in advance guys, Chetan

      C Offline
      C Offline
      Chetanfcc
      wrote on last edited by
      #2

      Hey All, I figured it out! All i needed to do was to encode only the Arabic part of the text using HttpUtility.UrlEncode text= HttpUtility.UrlEncode(Text.ToString) and then attach it to the URI. This way the server(processing page) at the other end is able to decode the characters correctly. Thanks

      P 1 Reply Last reply
      0
      • C Chetanfcc

        Hey All, I figured it out! All i needed to do was to encode only the Arabic part of the text using HttpUtility.UrlEncode text= HttpUtility.UrlEncode(Text.ToString) and then attach it to the URI. This way the server(processing page) at the other end is able to decode the characters correctly. Thanks

        P Offline
        P Offline
        Pierre Francis
        wrote on last edited by
        #3

        thanks for the hint, but UrlEncode changed the ?????? characters to be like that %3f%3f%3f%3f%3f%3f% so still it isn't arabic !

        M 1 Reply Last reply
        0
        • P Pierre Francis

          thanks for the hint, but UrlEncode changed the ?????? characters to be like that %3f%3f%3f%3f%3f%3f% so still it isn't arabic !

          M Offline
          M Offline
          Mohammed Derbashi
          wrote on last edited by
          #4

          use URL Decode on target page

          Thank you, M. Derbashi

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups