Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi to all Xtremers,

 

 

i have this URl

 

ahttp://csp10.link.pt:100/carrinho/CheckEportal.aspx?Name=GUIAS%20ESPIRITUAIS%20PARA%202003%20-%20VenÊncio,%20Agendas%20-%20Arteplural%20Edicoes&id=1498&lang=1

 

As you can see, i in the query string parameter Name there is a accentuated character (the Ê).

 

when i run this code

 

String QUERYSTRING = Request.ServerVariables["QUERY_STRING"];

 

When an accentuated character is present in the query string it is skipped so i get Venncio instead of VenÊncio.

 

how can i resolve this?

 

thx to all

Edited by FastRodas
Posted
If Querystring can't handle it, then you may consider other method to pass your value, like Form Post, cookies, session, viewstate, database... it depends on your needs
Posted (edited)

I cant do that...

 

i have to pass it through the url. The problem is that i am from Portugal and in my language there are lots of accentuated characters. For example

á, à, ã etc.

 

and these characters are skipped when i do the QUERYSTRING = Request.ServerVariables["QUERY_STRING"];

 

i'm a little lost...i tried lots of encoding and none worked. I am thinking that since ASP.NET is server side i could be that the server was not well configurated. But i checked that and it is all PT.

 

in the web.config i changed the settings to PT

<globalization requestEncoding="any valid encoding string"

responseEncoding="UTF-8"

fileEncoding="UTF-8"

culture="pt-PT"

uiCulture="pt-PT" />

 

so...if anyone can help i would appreciate it

Edited by FastRodas
Posted

well the bad news for you are that, you can't use non american characters, so you'll have to change the ê for a simple e, just look for a domain with a ñ or a ê, you'll find none.

This is told in the W3C standards for domains

Fat kids are harder to kidnap
Posted

Well....i found a solution for my problem. I guess it is not the best way but what the heck!! it works!!

 

what i do is when i pre-generate my url, before í store it in my database i check it for accentuated characters and change them.

 

for example if i have an à it is changed to %E1, an é to %E9, etc.

 

So when i get the query string, before i use it i just have to undo the changes....and voila!!

Posted
If you want to store that in database, then why still need to pass through querystring? Just use database to keep your data passing, don't you think it is more easier?
Posted

Can easily be done by looking the System.Web.HttpUtility.Encode........

There's a lot there ! even an UrlEncode... so might want to look at it ?

Things done automaticly are way more funny :)

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...