11

This is about an issue I've faced twice up until now.

Today I asked this question How to decode an URI with UTF-8 characters in C++ and I received a response that was def what I needed to figure out the final solution.

However, there's a little more work to have my code handle UTF-8 URIs. I did that and wanted to share that as well on SO, so that if someone else faces the same issue, they can copy and paste my code (also, if someone finds something wrong with my code, I'll probably hear in the comments).

My question is... should I post another answer, including the code? if so, should I mark it as accepted? or should I just edit my original question including how I solved it?

I like the idea of posting an answer b/c it's what I'm really doing, answering my own question... but also, I want the person who helped me to have the recongition he deserves...

Thanks!

14

Should I just edit my original question including how I solved it?

Do not edit your original question to include an answer.

However, there's a little more work to have my code handle UTF-8 URIs. I did that and wanted to share that as well on SO.

Oswald could have posted an exact snippet as well, but he chose to point you in the right direction and let you figure it out. Is Oswald's answer enough for future visitors to fix the issue?

If you've developed an answer to your own question, then I'd say it'd be a good thing to include it. If it's general enough of an answer that they could quickly apply it to their own situation, and it's more complete than other answers, you could accept it too. That's allowed on SO, and there's even a "Self-Learner" badge.

If you choose to do this, I'd upvote the previously accepted answer, so future visitors know it was helpful too. I might not get into the habit of changing the accepted answer to your own though, unless yours is a significant improvement, as it may rub people the wrong way.

6

Posting your solution as an answer would be the best option. Don't post just the code, but explain what you did and why you did it to make it even better for future visitors. (Additional information like what headers you needed to add and how you linked to the required libraries would be bonus).

Whether you change the accept or not is up to you. I think the polite thing to do would be not to change it, but since you did do a lot of work on your own on this, changing it might be ok. (I don't think I would though.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .