1

I have urlDecode function.

But when i'm decoding some string like: P%C4%99dz%C4%85cyJele%C5%84

I get output: PędzącyJeleń

Of course this is not correct output. I think its broken because there are Polish chars.

I try to set in compilator: Use Unicode Character Set or Use Multi-Byte Character Set

I try to do that using wstrings but i have a lot of errors :| I suppose that i should use wstring not string but could you tell me how? There is not easier way to solve my problem? (i listen a lot about wstring and string and litte dont understand - wstring should not use on linux, but i have Windows)

//link to my functions at bottom

http://bogomip.net/blog/cpp-url-encoding-and-decoding/

//EDIT

When i change all string to wstring, fstream->wfstream

It still problem look:

z%C5%82omiorz - this wstring (from file ) != złomiorz , but this function print me L"z197130omiorz"

what is 197130 ? How to fix that ?:0

4
  • This is a UTF-8 string with the urlEncode method, so what you are getting from urlDecode is a UTF-8 string. Windows does not handle UTF-8 natively, you need to convert it to whatever character set you are using. Commented Aug 9, 2014 at 20:52
  • @n.m i have to convert string or wstring from urlDecode ? Can you show some example, please :) I never do that :( Commented Aug 9, 2014 at 21:04
  • urdDecode returns a string. You can try to convert that string from UTF-8 encoding to a wstring. Try a function from here. Commented Aug 9, 2014 at 21:24
  • @n.m. okey, so i dont have to read file in wstring ? Only url_decode to wstring, and keep this data in wstring 'oh sorry, only decode urldecode output from string to wstring Commented Aug 9, 2014 at 21:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.