Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert string from encoding codes to charactes?

Tags:

c#

.net

I have a text of strings that looks like:

%D0%A1%D1%82%D1%80%D0%BE%D0%BA%D0%B0

How can I convert it to actual characters? If I'm understand it right it's UTF char codes.

like image 273
Jcf Avatar asked Aug 20 '26 17:08

Jcf


2 Answers

It is URL-encoded:

var s = System.Web.HttpUtility.UrlDecode("%D0%A1%D1%82%D1%80%D0%BE%D0%BA%D0%B0");

Produces:

"Строка"

Which is Russian for "row" or "string", I think.

like image 85
Hans Passant Avatar answered Aug 22 '26 07:08

Hans Passant


See the accepted answer in this post, you just need to change their "-" to your "%"

like image 32
musefan Avatar answered Aug 22 '26 06:08

musefan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!