login about faq

Hello, I am a long time user of your ChilkatSoft utilities.

Can you help me with something?

I am trying to figure out if we can decode a % encoded URL string. It’s in European characters and comes from us via a website in Europe.

This is in Bulgarian

For example, we get something like this that a user types into a web page…

(example #1)

котката в шапката се връща

But when that information gets transferred to us… we see it encoded like this…

(example #2)

%D0%BA%D0%BE%D1%82%D0%BA%D0%B0%D1%82%D0%B0+%D0%B2+%D1%88%D0%B0%D0%BF%D0%BA%D0%B0%D1%82%D0%B0+%D1%81%D0%B5+%D0%B2%D1%80%D1%8A%D1%89%D0%B0

I need to know if we can figure out a way to translate this to the Bulgarian characters from the encoded format.

Does your Charset component handle this?

asked Jul 12 at 13:20

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


The solution is to URL decode to bytes, and then interpret the bytes according to the correct character encoding (utf-8, Windows-1251, etc.) to get the string.

It turns out this data is the utf-8 representation of the Bulgarian text.

This is an easy solution in C#:

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

crypt.CryptAlgorithm = "none"; crypt.EncodingMode = "url"; crypt.Charset = "utf-8";

textBox1.Text = crypt.DecryptStringENC("%D0%BA%D0%BE%D1%82%D0%BA%D0%B0%D1%82%D0%B0+%D0%B2+%D1%88%D0%B0%D0%BF%D0%BA%D0%B0%D1%82%D0%B0+%D1%81%D0%B5+%D0%B2%D1%80%D1%8A%D1%89%D0%B0");

link

answered Jul 12 at 13:22

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

edited Jul 12 at 13:22

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1
×1
×1

Asked: Jul 12 at 13:20

Seen: 156 times

Last updated: Jul 12 at 13:22

Related questions

powered by OSQA