0

hey guys in first place i would be thankful for all of you im using asp.net im trying to rewrite my URL but i have an issue that when I'm trying to share my link or write it in my XML sitemap file it's become that's way

   https://www.me-future.com/Articl/3157/%D8%A7%D8%AD%D8%B0%D8%B1-%D9%85%D9%86-%D8%A7%D8%B3%D8%AA%D8%AE%D8%AF%D8%A7%D9%85-%D9%87%D8%A7%D8%AA%D9%81%D9%83-%D8%A7%D9%84%D9%85%D8%AD%D9%85%D9%88%D9%84-%D9%81%D9%8A-%D8%AA%D9%84%D9%83-%D8%A7%D9%84%D8%AD%D8%A7%D9%84%D8%A7%D8%AA-

but my URL should be that's way

   https://www.me-future.com/Articl/3157/احذر-من-استخدام-هاتفك-المحمول-في-تلك-الحالات

thx a lot for your help guys and thx for your time

  • Does this answer your question? [Unicode characters in URLs](https://stackoverflow.com/questions/2742852/unicode-characters-in-urls) – Heretic Monkey Jan 17 '20 at 03:01
  • for sorry no the problem is when i try to share my link it's at social networks it's turn into Latino charter it's work and my follower can enter the link but it's looking bad plus the sitemap URL it's Latino character too im using asp.net any way thx a lot for you help I'm really grateful –  Jan 17 '20 at 03:10

1 Answers1

0
Get the original url before sharing it to the others like this :
    var originalUrl = System.Net.WebUtility.UrlDecode("https://www.me-future.com/Articl/3157/%D8%A7%D8%AD%D8%B0%D8%B1-%D9%85%D9%86-%D8%A7%D8%B3%D8%AA%D8%AE%D8%AF%D8%A7%D9%85-%D9%87%D8%A7%D8%AA%D9%81%D9%83-%D8%A7%D9%84%D9%85%D8%AD%D9%85%D9%88%D9%84-%D9%81%D9%8A-%D8%AA%D9%84%D9%83-%D8%A7%D9%84%D8%AD%D8%A7%D9%84%D8%A7%D8%AA-");
Hamza Khan
  • 66
  • 6
  • var originalUrl = System.Net.WebUtility.UrlDecode("https://www.me-future.com/Articl/" + lblRoutid.Text); –  Jan 17 '20 at 17:25
  • it's still not working when im trying to share or write in my xml file –  Jan 17 '20 at 17:25
  • @DarwieshMustafa what's the exact value in "lblRoutid.Text" – Hamza Khan Jan 18 '20 at 08:47
  • thx for replying me the lblRoutid.Text = Page.RouteData.Values["name"] as string; –  Jan 18 '20 at 11:24
  • @DarwieshMustafa i think you have to cross check this concatenation "me-future.com/Articl" + lblRoutid.Text". i.e the exact value of Page.RouteData.Values["name"] . – Hamza Khan Jan 22 '20 at 10:43