简体   繁体   中英

QueryString encoding of non-ANSI characters in ASP.Net

I'm passing "Malmö" as a Request.QueryString parameter to a page. However, the code sees it as "Malm " meaning that string comparison fails. All globalization settings are set to UTF-8 in web.config. Am I missing something?

Edit: The querystring looks like this http://localhost/PageName/?courseKommun=Malm%F6

%F6 is not the URL encoding for ö , that's why you don't see an ö .
The correct URL encoding would be %C3%B6 ( see ).

It should work just fine with both versions:

  • /?courseKommun=Malmö
  • /?courseKommun=Malm%C3%B6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM