problem with passing string with special character

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi,

I want to pass a string with a special character (ê).
The problem is that the starting string "enquête" arrives as "enqu".

Why is this and how to solve that?
Thanks
Bob

Dim enqna As String
enqna = "enquête"
Response.Redirect(String.Format("next.aspx?Item0={0}", enqna))

next.aspx:
 
You need to URL encode the string before adding to Response.Redirect.

HttpUtility.UrlEncode(enqna)

You will see ê as a UNIX char. Not sure what, but it will be in the format
&###; so the url will be:

http://mysite.com/next.aspx?Item0=enqu&###;te

with the ### being some number

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

*************************************************
| Think outside the box!
|
*************************************************
 
uri's (url) only support a subset of ascii, no international characters. you
will to urlencode the characters, and be sure to use the correct encoding on
the decode side. see HttpUtility.UrlEncode

also see:

ftp://ftp.isi.edu/in-notes/rfc2396.txt


-- bruce (sqlwork.com)
 
Thanks

bruce barker said:
uri's (url) only support a subset of ascii, no international characters.
you
will to urlencode the characters, and be sure to use the correct encoding
on
the decode side. see HttpUtility.UrlEncode

also see:

ftp://ftp.isi.edu/in-notes/rfc2396.txt


-- bruce (sqlwork.com)
 
Back
Top