#5 Safely Linking URLs with Umlauts and similar
Safely Linking URLs with Umlauts and similar
⬇️ Result | Source ➡️
☝🏽 this image is called göögle plus.png
- which must be encoded to
g%C3%B6%C3%B6gle%20plus.png
Sometimes you have files with unexpected characters - like umlauts or spaces. The best way to encode this is using Tags.SafeUrl(...)
from RazorBlade, or Uri.EscapeUriString(...)
from .net.
Important notes
- Two characters won't resolve properly on a standard web server:
+
and%
. There are ways to work around this, but we would avoid them at all cost. - Other characters like
spaces
, umlauts (öäè
) etc. are no problem. - You may also find suggestions to use
Server.UrlEcode(...)
. This often doesn't work! - Remember to add
@@using System
to make this fly
#5 Safely Linking URLs with Umlauts and similar