How to

encode unicode URL

Published: 5. February 2015 | Updated: 5. February 2015
License: Microsoft Public License (MS-PL)
Categories: Network
Tags: C# Network Text
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at analyzant.com

Import namespaces

using System;

Code

var url = new Uri("http://ja.wikipedia.org/wiki/メインページ");
var encoded = url.AbsoluteUri;
Console.WriteLine(encoded);
Console Output:
http://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8
Send us feedback about this snippet »



Related Snippets: